crush/CrushWrapper: fix detach_bucket

In commit 9850227d2f0ca2f692a154de2c14a0a08e751f08 we changed the call that
changed the weight of all instances of item to one that explicitly
changes it in the parent bucket, but parent_id may not be valid at the
call site.  Move this into the conditional block to fix.

Fixes: #10095
Signed-off-by: Sage Weil <sage@redhat.com>
Merge pull request #2920 from ceph/wip-10095

crush: fix detach_bucket

Reviewed-by: Samuel Just <sjust@redhat.com>