Main loop scheduling

Two changes:
  - Fixes a bug where calling `emscripten_set_main_loop` with fps=0 in a sequence with `emscripten_cancel_main_loop` would not properly cancel the previous loops, but the rAF timers would stack up, calling the main tick function at a too fast rate.
  - Adds support for controlling swap interval as an Emscripten-native API, and in EGL, GLFW and SDL.
The existing `fps` parameter in `emscripten_set_main_loop` uses setTimeout if `fps > 0`, and rAF if `fps == 0`, and negative values are not allowed. I wanted to fix two issues with that: one is that it doesn't allow specifying swap intervals. That can be useful for powersaving purposes, or targeting a lower fps rate (30fps instead of 60fps), and will become very important in the future once 120 Hz and 144 Hz displays get more prevalent. For that I extended the existing `fps` parameter to use negative values for swap intervals: `-1` is every vsync, `-2`, every second vsync and so on.

The second problem I wanted to fix is that the existing `fps` parameter does not have the capability to express "render as fast as possible". It's only possible to express "render with a delay of 1.0 / 2147483647" at best by passing `fps=2147483647`, but such epsilon-like behavior is a bit clumsy, so I turned the meaning of positive values around for the new api, and numbers `>= 0` specify `msecs` instead of `fps` to fix the problem and allow specifying "render with a zero delay" in a natural way.