Make the logger thread-safe

Applied the patch suggested by @yogi in padrino/padrino-framework#815 to make the logger thread-safe. @DAddYE @nesquena