Fix closing the render thread.

This makes Windows happy when used in conjunction with qmelt.