More robust code for disabling js2 syntax checks when flycheck is active