bug fix: thread_begin & thread_end calls to debugger only in debug version