Fix error on connect when file descriptor is invalid

This may happen if the bot looses the connection to the server and tries
to reconnect.
Delete registration env if reusing connection fails

If reusing the connection fails, we have to connect to the server the
usual way. Then we will receive the registration lines from the server
again, so make sure the environment variable for IRC_REGISTRATION is
empty, so we don't parse the old ones.
Merge pull request #6 from trygveaa/connect-fix

Fix error on connect when file descriptor is invalid