Cannot wait for event in wx thread