[2.5] Fix for CDAP-1045 on Mac where /proc doesn't exist

This does not require a new release as the offending code was merged post `2.5.2` release, so it only affected builds from this branch made after the change was implemented running on non-Linux.