Support OSX environment

In OSX environment, backtrace(3) and pthread_kill causes SIGSEGV.