Fixed crash related to refreshing a wx Window class in a thread

Partial fix for #153