don't rely on JS errors to kill windowing process

this introduces #46, which is lower priority than some other issues, so
OK for now