Handle responses other than ok by closing the connection.
Merge pull request #15 from aeden/master

Fix issue where response is not ok in handle_response