fold: make sure we move bookmarks after folding (issue5772)
The rewriteutil.rewrite() API currently only handles moving bookmark from a old
node to new node. In case on fold, we have multiple old nodes, from where a
bookmark move is possible. The rewriteutil.rewrite() API is used by another
commands also and it's not good to plug in some logic there. This patch handles
bookmark movement from all the old nodes to the new node.