Fixes #1650 where using a file-like object on Python 3 fails.  Use npy_PyFile_* compatibility methods instead of rolling it ourselves.
Clear exceptions if PyFile_Dup() fails -- we have a way to handle "non-real" file objects.
Copy over some of the Numpy file-handing compatibility functions.
Update backend_agg to use the Numpy file-handling compatibility functions.
Open files in binary mode.
Merge pull request #1650 from mdboom/png/fix_file_like_py3

_png.read_png crashes on Python 3 with urllib.request object