Btrfs: fix how we merge extent states and deal with cached states