Revert "use thread_safe gem instead."

This reverts commit eb87e265f75c49bcfc0fbfb829463111726bcef0.