Clear `connectionTimer` when a socket is closed

Otherwise, when the timer expires socket.end() is called that causes a TypeError inside node libraries.
Fixes #217