[libcommhistory] Fix unit tests for sqlite backend

ModelWatcher is refactored to handle synchronously-emitted signals
correctly, and be a bit more precise about the number of signals.

A variety of other issues in unit tests that were either incorrect or
have changed with the SQLite backend are also fixed.
Fix various regressions in CallModel revealed by tests