try/finally after store.attach to close sessions (See 9331)

See ticket for an example of an attempt to reproduce. As long
as `bin/omero sessions list` still functions normally, this
change can't really cause any issues, and should hopefully
prevent the issue in 9331.