Btrfs: fix race between device replace and chunk allocation