Fix thread variable error come from version 3.5.3 in static mode