Manually apply #166 by @joliver
Manually apply #166 by @joliver

Fixes #165. See https://github.com/streadway/amqp/pull/166#issuecomment-268774971 for
a justification of not adding any tests.

This is different from the original patch because
SetDeadline argument type seems to have changed.

Per discussion with @gerhard.

streadway/amqp,streadway/amqp