Refactor to prepare linux to use posix_spawn.