Added fflush() in stdout capture test, as this is needed for standard out to be sent out when not connected to Xcode debugger