Use a global HDF5 lock (trac: 10464) (rebased onto dev_5_0)


This is the same as gh-2688 but rebased onto dev_5_0.

----

*Opening against develop instead of dev_5_0 in case it deadlocks the demo*

See: https://trac.openmicroscopy.org.uk/ome/ticket/10464
Particularly: https://trac.openmicroscopy.org.uk/ome/ticket/10464#comment:11

Testing: Modify the connection details in the following script
https://gist.github.com/manics/b03acf51254b16c30d3b
and run `python tables-crash.py 100 100` from 5+ teminals at the same time. This will create 100 tables/script, and for each table will make 100 calls to addData. With a standard HDF5 install (e.g. `brew install hdf5` without any custom options) this will probably fail after less than a minute if you connect to a server without this PR. Then try again with this PR merged and it might work. In theory this could be tested against trout-latest and trout-merge if you set the right ports.

If that works then check for deadlocks.

Note this reverts #2621