Simplify btrfs_get_parent(), fix use-after-free bug