SERVER-11665: fix getLastError reporting of some errors