Double deletion bugfixes

Double deletions with multiprocessing don't clean up appropriately when interrupted (such as with control c or Interrupt Kernel in IPython). This was causing the IPython notebook to crash. Use a context manager to ensure interruptions are handled gracefully.