RedMine 6397: rewrite SplitProcLine and clean up in its file

Long over-due clean-up and reworking.
See commit comments for explanations of the various parts of the whole.

For 3.6.x, it's possible the "RedMine 6397 mitigation" commit is enough to fix Solaris's problems.