Set detached option to true only on Unix (causes issues on Windows)