Btrfs: Fix race in btrfs_mark_extent_written