let EXPLAIN use a thread locals registry [John J. Wang & Xavier Noria]

Closes #10198.