(thread_atfork, thread_atfork_static): New macros to encapsulate