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, the "RedMine 6397 mitigation" commit is enough to fix Solaris's problems.
Well, it *can* get below outer here, but the next thing after this loop is exactly a check for that.