Fix race condition in problem listing generation