NXBT-674: take care of the exit code even on windows