Process spawning in C with threads/popen.