journal: take wlock for writting the 'shared' file
As we did for the shared extension itself, we add some locking around the write
of the 'shared' file.
To run the tests, do:cd tests/python run-tests.pySee https://mercurial-scm.org/wiki/WritingTests formore information on writing tests.