detect-os.js: add a couple of safety checks.
detect-os.js: add a couple of safety checks.

mpc-hc/mpc-hc.org,mpc-hc/mpc-hc.org,FeodorFitsner/mpc-hc.org,FeodorFitsner/mpc-hc.org,mpc-hc/mpc-hc.org,FeodorFitsner/mpc-hc.org