SERVER-10712 remove duplicate code in mongodump