portable run-program and funcall+thread