Check whether to enable threaded compositing

Part of Fix #1340