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.

Let's use braces {}