Ensure file descriptors are closed when resetting Process object.
Adds a lsof like utility function.