[PATCH 4.14 016/161] Btrfs: fix removal logic of the tree mod log that leads to use-after-free issues