(Merge 3.2) logging: don't define QueueListener if Python has no thread support