Fix race when the emulator starts slowly