omero gateway flake8 cleanup: Fix failures and warnings (dev_5_0)

--rebased-from #2251