SERVER-13265 Fix race condition in mongorestore startup
(cherry picked from commit 47ce3aebb48d9b9191584e3173774e29a0a3808c)