Cleanup TableI.close() #11697

* Fix a log statement that was dereferencing a null OriginalFile hash resulting in an exception.
* Retrieve the group ID if the OriginalFile given to `openTable` was unloaded (http://trac.openmicroscopy.org.uk/ome/ticket/11697).
* Don't `close()` if it's already been called.
* Only update OriginalFile if the table was modified.

Testing: The following should not result in `WARN`/`ERROR`/exceptions in `Blitz-0.log` and `Tables-0.log`:
Open and close a table with a loaded OriginalFile:
`t=res.openTable(qs.get('omero.model.OriginalFileI', id))`,`t.close()`
Same for unloaded:
`t=res.openTable(omero.model.OriginalFileI(id))`,`t.close()`

Repeat this for a file/table in a different group:
`t=res.openTable(..., {'omero.group':'other_gid'})`

Check log files after calling `close()`- OriginalFile shouldn't be updated if only reads were performed.

If you're feeling brave try opening the same table concurrently (it shouldn't be any better/worse than before), or figuring out what will happen if an exception gets thrown halfway through a write.