Adding try/except around socket shutdown to fix running this on OSX. No, I don't mine on OSX, just develop :) https://code.google.com/p/py-amqplib/issues/detail?id=45