Remove connected and failed listeners on close

I noticed the `connected` and `failed` event listeners are not removed when connection is closed, causing them to pile up if connect/close cycle is called multiple times.

This fixes the issue by simply removing the listeners when `close()` is called.