parsers.c: fix a couple of memory leaks

--HG--
branch : stable
extra : rebase_source : 3e949541326e4d075704931c56d49327f3b13a06
tests: cat error messages are different on Solaris

--HG--
branch : stable
extra : rebase_source : edcab63f49fa40dd65bfb04dd83cba5662fc8100
extra : amend_source : 89583fd9cbc7748e32b05fbcf4d2ba5bb21968b3
revlog: make _chunkcache access atomic

With this and related fixes, 'hg serve' survived 100000 hits with
siege.

--HG--
branch : stable
extra : rebase_source : e64ced5c465d5b33440f97914a39a3581eb3c42b
revlog: hold a private reference to self._cache

This keeps other threads from modifying self._cache out from under us.
With this and the previous fix, 'hg serve' survives 100k hits with siege.

--HG--
branch : stable
extra : rebase_source : de619681792df24b247dede70adfce065f276c3e