Added 'process::inject::exited()' to simulate exited events in tests.

Review: https://reviews.apache.org/r/20504