put shared variables into thread-local storage

This doesn't solve the general design problem of the log.c (eg; some log lines
got lost or scattered into multiple files) but at least prevent multithreaded
code from crashing.

Before this change something like following;

sudo src/tests/lxc-test-concurrent -i 10 -j 20

was crashing nearly all the time due to 3afbcc4600a as we started to
set lxc.loglevel and lxc.logfile with that commit.

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>