Fix a race condition that is expose when running irc_test.