libprocstat: use elf_getphdrnum rather than deprecated elf_getphnum
PR: 273966
Reviewed by: emaste
(cherry picked from commit 633094c27f0ac1b1001d5bd24a883240b4bce1dc)
(cherry picked from commit fd8bf2ecc05af841aa7e8369a43861cdc122d404)