wait until the simulator exits
wait until the simulator exits

This fixes a regression introduced from fd3e9746aaeeb4703a326c37d2f7375518fe5fb6,
causing too early exit at the headless mode.

flintproject/Flint,flintproject/Flint