kernel - Fix races in disk iteration and diskctx handling