pclose the popened processes

This prevents two defunct sub processes hanging around.