Bug 991262 - WIP patch for race conditions with runapp cli var

https://bugzilla.mozilla.org/show_bug.cgi?id=991262