Get rid of catch-all exceptions.

See https://bugs.launchpad.net/pycrypto/+bug/1178485