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

anyhow, I find it ugly to have calls to bash, as I wrote I tried pure python but was afraid of 
getting something that usually works but sometimes fails obscurely, and was not capable to make it 
elegant anyhow. Of course if we want to be prepared to port to some platform where bash isn't 
available...