Ensure compilation to Javascript with Emscripten

This small commit ensure that (the core of) OpenCV can compile to JavaScript with Emscripten.

Successfully compiles `core`, `imgproc`, `calib3d`, `feature2d`, `video`, `highgui`, `superres`, `objdetect`, `shape`, `bioinspired`, `contrib`, `legacy`, `photo`, `ml`.

Note that one pending issue is still required in Emscripten: https://github.com/kripken/emscripten/issues/1860

Sibling pull-request for branch master: #1904