tags: write tag overwriting history also into tag cache file (issue3911)

Before this patch, tag overwriting history is not written into tag
cache file ".hg/cache/tags".

This may give higher priority to local tag than global one, even if
the former is overwritten by the latter, because tag overwriting
history is used to compare priorities of them (as "rank").

In such cases, "hg tags" invocations using tag cache file shows
incorrect tag information.

This patch writes tag overwriting history also into tag cache file.

--HG--
branch : stable
Added tag 2.7.1 for changeset 335a558f81dc

--HG--
branch : stable
Added signature for changeset 335a558f81dc

--HG--
branch : stable
merge with stable