Fix thread safety of host tracking.