The bgsync _producer() method runs in a loop until stop() is called asynchronously.
If, after this critical section is run
stop() is called (as it would be during step-up), then before
is reached, the primary clears the applied-through time (as it normally does), the applied-through time will be re-set to the last applied optime. This state will persist until the next time the node becomes secondary and applies a batch. If the node restarts during that time, it will invariant and need to be re-synced.
We need to hold the mutex and ensure the producer is running while checking if applied-through is clear and setting it.