btrfs: refactor __btrfs_run_delayed_refs loop