core: allow passing the cwd to fork()