Fix example so that it runs in existing event loop.

This was a known issue (see FIXME comment that was deleted in this commit).