Preserve ordering of event buffer when filtering on name

Fixes a nasty bug in event watches. What happens is when multiple events with different names get fired in a non-sequential order, and we then filter on the event names, the order of the events gets mixed up by relocating the very last index to the middle of the event buffer slice. This can cause the event index to be returned incorrectly since we just take the very last matching event in the event buffer and compare its index with the watch request, which ultimately leads to event handlers not being fired when they should be.

Fixes #479
This looks like fun logic to have been twiddling.