bookmarks: pull --update updates to active bookmark if it moved (issue4007)

This makes `hg pull --update` behave the same wrt the active bookmark as
`hg pull && hg update` does as of 2096e025a728. A helper function,
bookmarks.calculateupdate, is added to prevent code duplication between
postincoming and update.

--HG--
branch : stable
extra : rebase_source : 7c348a4c81db8dd55490455d8caea1a440daecde
extra : amend_source : 35648f16f802440c11c57774d4c98ea396a35d26
Added tag 2.7 for changeset f37b5a17e6a0

--HG--
branch : stable
Added signature for changeset f37b5a17e6a0

--HG--
branch : stable