Fix bug in resource event distinct select

I somehow managed to leave out one of the primary keys for a
resource event in the join that I was using to filter out
multiple events on the same resource.  This was causing
various count results to show up with extremely inflated
numbers.

This commit tweaks the test data such that it highlights
the issue, and also fixes the bug.