elease locks on error in `deleteGhost`.

Closes #278.