Do not always capture stdout - only when we need it

Hi Manfred,

Ran into out of memory issues with the native plugin and it was due to the fact that the complete std out was captured by default.

This patch only captures std out when it is really needed.

Johan