Only sleep if process hasn't been killed