Fix aggregate_get_by_host host filtering

aggregate_get_by_host never actually joins the _hosts relationship,
so aggregates with non-matching hosts are still included in the output.

This change adds the join and improves the tests to cover the bug.

Fixes bug 1201277.

Change-Id: I87ebfe3de193b9ae47e3a2c8350a49d9cc863fb0
Merge "Fix aggregate_get_by_host host filtering"