run_fork_with_timeout: allow returning complex structures