Avoids race condition in tests and cleans up
Avoids race condition in tests and cleans up

* Make sure we sleep for a tiny bit after sending a KILL to disc. This
  ensures that the next time we boot up it actually finished (why this
  is a problem is still unclear, but the tests where failing for me
  because of this.

* Avoid repeating a lot of code by extracting the process handling code
  into test helper functions.

pote/disc,pote/disc