check the status of the connection periodically

currently erbot does not implements all the irc commands. so there is a
posibility that erbot is up, but without actually communicating with the
server. make sure that we receive ping or some data atleast once every 5
minutes.
quit on tcp close message.