Fix race conditions in pldd that may leave the process stopped after detaching