Use locking to wait for gui thread initialize instead of a half-second delay.