btrfs: split write_dev_supers to two functions