[#81669] Backport upstream OpenLayers TileManager

Backport of TileManager form upstream OpenLayers.
Comes from https://github.com/openlayers/openlayers/blob/cd2cd9/lib/OpenLayers/TileManager.js.
openlayers/openlayers@cd2cd90f96ad76715c6fd0e31bd6926bd78e8233