Fix thread local storage calculation bug in libtrycatch