block: Fix dev_t minor allocation lifetime