Fix synchronization issue in the stopless recovery unit test