heap: fix `heap_remove()`

Remove should shuffle items in both directions, not just down. It is
required, because `max` node could be not the actual maximum value in
the tree.

fix #1267