Fix concurrency issues in the stopless recovery unit test