Safeguard against excessive creation of file descriptors due to leaked PDPipes.
Added PD_DEPRECATED.
Some clean up.