SERVER-13337 support queries with projections in the idhack runner

(cherry picked from commit 10d8b3d7984a4abf0d8f80562d426d2f5f0707c3)

Conflicts:
	src/mongo/db/query/idhack_runner.cpp
SERVER-14186 check for ismaster under write lock

We need to check master-ness under a write lock before doing a logOp() or else
the server might shut down.
Merge remote-tracking branch 'upstream/v2.6' into v2.6