promise: Fix SpiderMonkey strict mode warnings
promise: Fix SpiderMonkey strict mode warnings

By default, our JS engine warns a bit overzealously about functions that
don't always return a value; fix this by moving some return statements
around. It also warns about 'use strict' used elsewhere than the very
beginning of a function or file, so fix that as well.

(You can turn off the extra warnings with GJS_DISABLE_EXTRA_WARNINGS, but
we don't want the user to see extra warnings from the Promise code even
if extra warnings are turned on. We can't disable the option from code,
as it is set per context.)

We annotate all modifications to the original Lie code with comments, so
it's easy to tell what to modify if we ever wanted to pull in a new
version.

https://bugzilla.gnome.org/show_bug.cgi?id=608450

endlessm/gjs,endlessm/gjs,endlessm/gjs,endlessm/gjs,endlessm/gjs