mnt: Fix the error check in __detach_mounts