Better localStorage support check

Inspired by Modernizr.