[PATCH 05/12] qemu: monitor: Unify and refactor 'PTY' case in qemuMonitorJSONAttachCharDev