fix sqs's hang on aws internal error

this pull request incorporated the patch mentioned in https://logstash.jira.com/browse/LOGSTASH-2205.