SERVER-14475 Cleanup the shutdown code and indicate shutdown earlier
SERVER-13961 Cleanup some nested instantiations of OperationContextImpl in repl

These are causing deadlocks if LockState is removed from TLS because of
pseudo-conflicting locks on the same code path.
SERVER-13961 Pass OperationContext into WhereCallbackReal

There are no functional changes in this commit, just preparation for the
subsequent one, which will add operation context to the JS execution
scope.