Optimize free thread contexts bookkeeping.