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.
Yes, it is inconsistent with the fps value in `emscripten_set_main_loop`, but can't change the existing fps parameter in `emscripten_set_main_loop`. What do you mean by adding to all places? I don't think we want to change signatures of "published" functions? The "as fast as possible" is very useful, and there is a possibility of matching it to https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/setImmediate/Overview.html in the future.