protocoldetector: Introduce _close_connection

In http://gerrit.ovirt.org/33982 we learned that having to both remove a
connection and close the socket is error prone. We have 4 places where
we do this, and one other place where we remove a connection, and close
the socket only if detection failed.

This patch simplifies the rules and removes duplicate calls to
self._remove_connection() followed by socket.close() by introducing
_close_connection(). _close_connection() is used for all fatal errors,
and _remove_connection() is used only when detection is successful.

Having this method, we can clean up connection handling around protocol
detection. Previously we used to remove the connection before trying to
detect the protocol, and if protocol detection failed, the socket was
closed. This also fixes logging, so we first report that a protocol was
detected, and then report that the connection was removed.

Change-Id: I522dbe8d6e0bccaa9e85dba3f28bed44d80988eb
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/33988
Reviewed-by: Piotr Kliczewski <piotr.kliczewski@gmail.com>
Reviewed-by: Dima Kuznetsov <dkuznets@redhat.com>
Reviewed-by: Saggi Mizrahi <smizrahi@redhat.com>