MFH: r542913
x11/wev: backport memory leaking fix
Approved by: ports-secteam blanket (reliability fixes)