Replace potentially unsafe wxPostevent() with wxQueueEvent() and Clone().