add ubi detach support, fix handling for kernel/rootfs ubi partitions