Don't check the time more than needed when locking
SERVER-16031 Call cleanShutdown rather than deleting KVEngines

Resolves some race conditions on shutdown.
Merge remote-tracking branch 'upstream/master'