SERVER-16431 Move the acquisition of the flush lock to a separate method

Also adds assertions and new tests. No functional changes yet - this is in
preparation for removal of the parallel batch writer lock.