Fix hanging of diagnostics on Windows (see #10155)

This PR fixes https://trac.openmicroscopy.org.uk/ome/ticket/10155. To test, deploy the server on Windows and verify that `bin\omero admin diagnostics` shows all the information and doesn't stop halfway.