Only recover connection if it was NOT initiated by the application

Recovery should only happen if the application itself didn't explicitely
trigger the `close` functionality. The recovery mechanism would else
prevent a complete disconnect.
Merge pull request #31 from smee/master

Only recover connection if it was NOT initiated by the application