move stopping the keyboard monitor on program exit out into the core. (dm)