Fix wrong number of bad hosts & triggers of a server

In the previous implementation "numberOfBadHosts" exists only in
each host groups, then the "numberOfBadHosts" for a server is
calculated by JavaScript side. But a host may be joined to multiple
host groups. In this case such host will be duplicated in the value.

And triggers have same problem.

I extract the test for TRIGGER_SEVERITY_ALL as another test.