Fix app build for Cordova

Caught by a zillion tests, oops.  But not by --prepare-app!
"Fix" bizarre memory corruption (?) bug

See #3285.  For some reason, in some mostly-replicatable circumstances,
this is necessary.  Clearly some sort of V8/Node/Fibers bug.