Fix a potential crash in XResources

5ac7b3 introduced a ThreadLocal variable which was not correctly
initialized for all threads. Thanks to Tungstwenty for the heads-up!