pclose the popened processes

This prevents two defunct sub processes hanging around.
Merge pull request #37 from johnf/defunct

pclose the popened processes