FIX isfileobj accepts write-mode files under PY3

Under Python 3, files open in write mode were not recognized as file objects, triggering large memory copies with `np.save`.
we have another of these in test_io.py, it should probably be moved to testing.utils