Preserve the interrupt state and return thread ID in corelib(open).
Preserve the interrupt state and return thread ID in corelib(open).

KnightOS/corelib,unlimitedbacon/corelib,jacobly0/corelib,MaxLeiter/corelib