fix bugs in log.h, add scope_guard and spinlock for c++11