fix data race condition (described here: https://code.google.com/p/log4go/issues/detail?id=15)