Move EventHistoryQuery::joinHostgroups() to all its subqueries

Statehistory
Downtimestarthistory
Downtimeendhistory
Commenthistory
Commentdeletionhistory
Notificationhistory

refs #4474