A Japanese space probe picked up just the right amount of speed when it flew by Earth earlier this month, using the planet’s gravity to slingshot toward an asteroid scientists think is a primordial leftover from the ancient solar system, mission managers said Monday.