SERVER-10712 remove duplicate code in mongodump

Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>