capture: cleanup stdout,stderr,rc files

The same tmp files are re-used for saving stdout, stderr and the
return code of the command wrapped by the capture function.

Internally, the 'tee' tool is used for dumping the output to
the tmp files. Old data in these files will survive until the
'not appending tee' will overwrite the tmp files. If the captured
command is not printing any output the old files will even
survive the capture function.

Now cleaning these files up by truncating them to a file size
of zero.