Fix a freeze in the Ruby RequestHandler tests, caused by a race condition.