Backport fixes needed for Python 3.4 from Astropy

git-svn-id: http://svn6.assembla.com/svn/pyfits/branches/3.1-stable@2716 ed100bfc-0583-0410-97f2-c26b58777a21