Acquire repository lock forcefully (fix #12359).

This PR aims to fix [ticket #12359](http://trac.openmicroscopy.org.uk/ome/ticket/12359). The situation described in the ticket was not possible to reproduce. Hence applying common sense here. The test class ``LegacyRepositoryUnitTest.java`` is now fixed.

To test:
- Verify that ``LegacyRepositoryUnitTest.java`` has no errors (``./build.py -f components/blitz/build.xml test -DTEST=ome/services/repo/test/LegacyRepositoryUnitTest`` - but only if your binary repo is ``/OMERO``),
- Verify that the server starts up,
- Verify that after server shutdown, the ``.lock`` file is deleted from ``/OMERO/ManagedRepository/.omero/repository/<uuid>/``

/cc @dpwrussell
The ``try/catch`` tries to cater for the situation where we fail to obtain a lock for the second time and throws an exception. I guess I could remove it...