SERVER-15597 Fix race condition in dumprestore7.js

Closes #825

Signed-off-by: Benety Goh <benety@mongodb.com>