Fix totalResults/next weirdness with inaccessible notes

The note access check was doing after the item search, which caused various issues. Note access is now checking by the search itself, so result counts should now be accurate again.

format=keys was also returning inaccessible notes in its list (though the notes themselves weren't accessible).
Fix broken test