fix for node-webkit

Hi , I use less in [node-webkit](https://github.com/rogerwang/node-webkit) project, `typeof(window)` is `true` because it contains webkit, so I use another detection method. Hope to be improved.
Cheers.