Backport 'Correct condition branches, should fix #14'

I would like to request that this bugfix be merged back into stable. This will allow applications using amq-client to correctly handle the `ConnectionClosedError` exception instead of receiving a `NoMethodError`.

This was simply a cherry-pick off master into the stable 0.9.x-stable branch. All tests pass.