Add flag to handleEvent to indicate if it should be tracked.

handleEvent() is called for all events, regardless of which API is hit.
This is problematic because the API affects if the event should be added
to the 'non-state' event history list. For example, room topic updates are
shown as messages. If the topic event was added to the list of events every
time without taking into account the source, it would be added twice when
there is an /initialSync request (once for the 'state' key and once if it
is in the 'messages' key). The flag added specifies if it is from the
'messages' key and therefore if it should be treated as a 'tracked' event,
rather than current state.