A minimal local storage wrapper that fallbacks to in-memory when localStorage is not available.