In python, flush during callbacks to write to sys streams. refs #883.