readline: move pause()

Move pause() before _setRawMode() in close()
Includes regression test
Fixes #5927

pause should be called with RawMode set to true, therefore in close()
the pause() should be before the setRawMode(false). This fixes a bug
where under windows 8 new instances of readline will not be able to
receive input until enter is pressed.