setup.py fixes

The first commit fixes LP#1055256 and #976171. The second commit is for  the problem described in http://lists.dlitz.net/pipermail/pycrypto/2012q3/000627.html.