Fix RT #97625 use-after-free in mysql_dr_error, and #86153