set connection status to closed on connection failure
use 1.8 compatible syntax
Merge pull request #190 from mhanne/close_connection_on_failure

Set connection status to closed on connection failure