[fixes #1571] Prevent simulated events from causing nested run-loops. 

Fix #1571 with tests, and small run-loop addition to help with these scenarios.