use PHP_OS rather than  to guess platform

PHP_OS should always be present, $_SERVER['OS'] isn't actually set on my system.  I had to guess what to use to make it work with windows though, so this should be tested.