Do not store arbitrary length header strings in the term_options array
fix handling of events triggered by closing the qt plot window