[Process] Close unix pipes before calling `proc_close` to avoid a deadlock

see http://php.net/manual/en/function.proc-close.php
merged branch romainneutron/unix-pipes (PR #8996)

This PR was merged into the 2.2 branch.

Discussion
----------

[Process][2.2] Close unix pipes before calling `proc_close` to avoid a deadlock

| Q             | A
| ------------- | ---
| Bug fix?      | potentially
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT

see http://php.net/manual/en/function.proc-close.php

Commits
-------

37102dc [Process] Close unix pipes before calling `proc_close` to avoid a deadlock