Update thread_safe dependency to version 0.3.1