[PATCH] db: Add more tests for retrieving subscribers from a DB and avoid NULL dereference when something goes wrong in tests.