add api useful for handling HiDPI

With this you can do something like:
```
double ratio = emscripten_get_device_pixel_ratio();
emscripten_set_canvas_size(w * ratio, h * ratio);
emscripten_set_canvas_css_size(w, h);
```
to get HiDPI webgl.
This should first call to `Element.getBoundingClientRect` to obtain the size, since that properly returns the size in fractional units. It is not supported in all browsers, so as a fallback if it doesn't exist, we should revert to the code implemented below.