Fix race condition in telnet tests.