Gets error status on POSIX & Windows
Implements sub_main, wrapped process entry point