Tools/connection_patcher: prevent closing window on windows outside of cmd

* should probably be used in all other tools as well
* implementation for unix may be wanted