Fix auto-exit on windows

Close stdin by using pause() instead of destroy(). This allows the script
to exit automatically on Windows.