Fix GH-12655: proc_open() does not take into account references in the descriptor array Closes GH-12658.