Made small changes to scheduler.

- Made the unused queue a bit simpler
- Made NMI handler pass through to prevent race conditions
- Added infinite loop after main exits