SERVER-14041 enhance secondaryThrottle parameter

This reverts commit 37f2a1e3b724dbd9e1f8eafd4ac87c5bf613c048 (undo revert).
This reverts commit d60fd22dec1c0bd104622eab463cdbba18bf11a9 (undo revert).
Fix Windows compile failure.
Add more defensive checks.
SERVER-14549 Don't send replSetUpdatePosition command unless all slaves have sent their handshake
SERVER-14581 add lockstate to cpuprofiler.cpp
SERVER-14186 map/reduce 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.

(PARTIAL cherry pick from commit f65ef0b5c272d94f500ea615e36023b45cdf088e)

Conflicts:
	src/mongo/db/commands/mr.cpp
	src/mongo/db/dbcommands.cpp