Make sure thread-storage is still set while calling
calcDefaultRegionOfDefinition...