Avoid calling cleanup twice on error condition
Merge pull request #20 from ElMassimo/cleanup-called-twice

Avoid calling cleanup twice on error condition