gexpect: capture process stdout/stderr to ease debugging
gexpect: capture process stdout/stderr to ease debugging

This commit adds a new function Capture() to gexpect. When called before
calling Expect*(), it will save the process output so it can be
recovered later with CollectOutput().

Based on tehnerd's solution:
https://github.com/ThomasRooney/gexpect/pull/4

ThomasRooney/gexpect,KSmerda/gexpect,nareix/gexpect,keybase/gexpect,tjyang/gexpect,davidwalter0/gexpect