Bug 1051172: send a 'stoprecording' signal from the system app so that the camera can stop recording quickly on app transitions r=kgrandon,justindarc a=2.0+

only send the special signal if an app is currently recording

fix the system app and camera unit tests

add tests for shared/js/stop_recording_event.js
Merge pull request #23118 from davidflanagan/bug1051172-v2.0

Bug 1051172: a stoprecording event hack so the camera can stop recording more quickly on app transitions. r=kgrandon,justindarc a=2.0+
Revert "Merge pull request #21602 from RudyLu/keyboard/Bug1034210_commit"

This reverts commit 12afc5ca3076ea8cbcd5989b32d9d1a4f092eb8f.
Merge pull request #21602 from RudyLu/keyboard/Bug1034210_commit

Bug 1034210 - send correct keycode for non-latin IME. (Re-landed)
r=timdream.
a=v2.0+
(cherry picked from commit 8a7fb294444869ddaf869a58b21588752b9ce561)