block: fix add_partition() error path