ENH: Make savetxt work with file like objects.

Accept any object with a "write" method as that is the only method
called by the code.
TST: Test that savetxt works with objects having a write method.
Merge pull request #3626 from charris/gh-3397

gh-3397