Run a function as a child process.