RF: check write attr of fileobject without writing

I was checking whether passed file object could write by doing a write
of an empty string. Writing an empty string can fail for bz2 objects in
python 3.3:

http://bugs.python.org/issue16828

In any case, testing that 'write' is callable with an empty string is
asking too much of the interface. Instead just check if the object has a
'write' attribute.
Merge pull request #3241 from matthew-brett/relax-mio-write-check

BUG: io/matlab: check write attr of fileobject without writing