store: Fixed JSON serialization when skipping hosts due to filters.

Previously, it might have happened that a comma was appended to a list of
hosts even though all subsequent hosts were filtered out. This created invalid
JSON. Now, don't let sdb_store_host_tojson ignore hosts entirely. Instead,
always let it serialize the host passed to the function and only pass on the
filter to child objects. The caller is now responsible for calling the filter
and, at the same time, the caller is able to correctly handle skipped hosts.

Fixed the unit-test which should have caught this.
frontend: Let FETCH/LIST/LOOKUP implementations accept filters.

This is in preparation for letting the parser support filters. It's not
actually used yet.