SERVER-8530 Prevent redundant logging of errors during queries