Wait for the child to exit in an attempt to get rid of zombie processes