Calculate pixelRatio before using it

This fixes a regression introduced by https://github.com/openlayers/ol3/commit/646dd18 where the device pixel ratio was used to determine the tile size even though serverType was not defined for the source.
Merge pull request #1580 from elemoine/1580

Tiled WMS broken on retina displays