Fixed defensive programing around #19924

If the share is closed, then db will be None, so calling is_closed()
won't work.
bz19942: fix watchhistory extension
Fixed apiexample extension.

Fixed new item filter code to allow extensions to modify it
bz19943: fix audio/video filters for watched folders

The issue was that when the user select the audio/video filter we
would try to select the "downloaded" filter as well.  This makes sense
for the library tabs, but doesn't make sense for watched folders.