Add more error handling to the ec2 module, remove Python 2.6ism