Add waitpong support

Some irc network uses 'waitpong' which sends PING before
establishing session and waits for PONG response. This patch
is an workaround for the problem.