tunning thread.sleep before and after process.destroy so mongod correctly creates required files