Partial fix for #9196 - better handling of bounding boxes of WMS layers

Do not use WGS84 bounding box for all layers - instead use either bounding box
as declared in capabilities document for requested CRS, or make best effort
to get bounding box from WGS84 bounding box.
Second part of fix for #9196 (WMTS)

If WMTS capabilities do not include a bounding box, try to detect it from
tileset matrix information (instead of using conservative assumption
that the layer spans the whole world: -180,-90 - 180,90 in WGS84)