Revert "remove static_lock()/static_unlock() and start to use thread local storage (v2)"

This reverts commit 95b422fccfed6e6f5973c768c0cfdbca65c68e67.

Conflicts:
	src/lxc/utils.c