Delay the terminate action to avoid race conditions.

This only appears in the tests; What happens here is that the satus has already
changed state when the websockets reads it and so a wrong value is returned.