* infrun.c (wait_for_inferior): Add support for dynamic function