Gaia Data Release 2: Kinematics of globular clusters and dwarf galaxies around the Milky Way