WDBS: safe check for window.localStorage

Pull request for https://code.google.com/p/selenium/issues/detail?id=7726 .
In my opinion, feature testing of localStorage is an overkill for such a simple script. But if you still think it needs to be done that way, I can update my pull request.

BTW, why don't just revert the localStorage code for AlertOverride, and use only old approach?
Do we really need localStorage for such action?