save 1st 1k and last 3k lines of cmsRun stdout instead of last 1MB, fixes #4277

I have seen cmsRun stdout's in the GB range so was not sure if I could "process it" in
python efficiently. So I thought better to use something old and solid like tail and wc
(besides optimized in good old ANSI C) rather then rewrite them in python.
But if people who know better tell me that my fears are without ground, I
will be glad to rewrite. Definitely I do not want to read all of the stdout
in a python list of strings to then print only the last N
(I did a quick search for tail implementation in python on stackoverflow,
and nothing was less then 10 lines)