fix issue #2082: output from greenlet or log is displayed above prompt thanks to stdout patch (from ptpython)