SERVER-10712 remove duplicate code in mongodump

Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>
SERVER-6219: Use ::mongo in macros

Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>
SERVER-10159 Fix invalid dereference of end iterator while parsing invalid field names