Sharpen count badges in sidebar
Reduce workload during search table re-population
Use IN rather than OR to avoid SQLite error w/ large queries
Increase window size during background prefetch

This will speed up the process of synchronizing with the server at
the cost of increasing delays when the user requests immediate
information, but experience shows this is worth it.

This also fixes a minor bug where closing the folder is not detected
during prefetch.