Make sure the STDIN is fully cleared when exiting. This fixes #2, Pressing arrow key will exit mem with garbage written to the terminal.