Fix race condition in backend login test