Update inbound event clearing logic

 - Clear acknowledgment events after processing at AckHandler

 - Clear all events after StateEventHandler processing is done.
Merge pull request #228 from Asitha/ack-null-issue

Update inbound event clearing logic