SERVER-13635 Fix legacy replication code locking behavior
Merge remote-tracking branch 'upstream/master'