#2097: Use localStorage.length instead to get number of entries

It looks like some older browsers are not compatible with the keys()
function of jquery.storageapi, but are compatible with just
localStorage.length.