python: support recording QMP session to a file