Make Grid pathfinding updates thread-safe