Changed NewEndpointClient connection closure implementation.
Changed NewEndpointClient connection closure implementation.

The NewEndpointClient function guarantees that it closes the provided
connection on failure, but it was missing closure in one spot. This
commit changes the way that the function closes connections on failure,
using a gated defer in the place of manual closure statements.

havoc-io/mutagen,havoc-io/mutagen