Delay the `threading.local` import to allow for eventlet/gevent monkeypatching.

Fixes bug 1294177

Change-Id: I51482148602d85e40230547d0e19cf0c2a0c6d8a