function: Don't call into JS if on the wrong thread

Checks that the current thread is the same thread as the JSContext was
started on. If not, refuses to call into JS.

Fixes #75.
5 jobs for 75-avoid-off-thread-callbacks in 13 minutes and 48 seconds (queued for 3 seconds)
Status Job ID Name Coverage
  Static Analysis
passed #8579
cppcheck

00:00:27

 
  Build
failed #8581
allowed to fail
fedora_clang

00:00:13

passed #8580
fedora_gcc

00:02:44

 
  Thorough Tests
passed #8582
coverage

00:10:23

 
  Failure
skipped #8583
on_failure
 
Name Stage Failure
failed
fedora_clang Build
-- Set Environment --
cp: cannot stat '/cwd/.cache': No such file or directory
Uploading artifacts...
WARNING: /builds/ptomato/gjs/.cache/jhbuild/build/gjs/test-suite.log: no matching files
WARNING: /builds/ptomato/gjs/.cache/jhbuild/build/gjs/config.log: no matching files
WARNING: /builds/ptomato/gjs/.cache/jhbuild/build/gjs/Makefile: no matching files
/builds/ptomato/gjs/coverage/: found 3 matching files

Uploading artifacts to coordinator... ok
id=8581 responseStatus=201 Created token=FVQhJif3
ERROR: Job failed: exit code 1