Get rid of buggy System.halt/2

Closes #1515, thanks to @AtKaaZ for debugging and pinpointing
this function as the root cause for output issues on Windows.