wait for forked jobs before returning

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>