mongodb/mongo — pull request #781 by dpercy (2014-09-18 16:22:16+00:00)
Title: Update saved OperationContext in all PlanStages

Every stage that has a field of type OperationContext*
should be updating it when ::restoreState(OperationContext*) is called.
Otherwise it is retaining a reference to deleted memory.

This bug hasn't surfaced before because:
1. the OperationContext used to be stack allocated, so it would have the
same address every time
2. mmapv1 doesn't always need to dereference the OperationContext