Remove the connection cache even though the workspace deletion failed
Also make the connection close conditional only when it is not closed already.
Merge pull request #20 from pkocandr/fixdeletion

Remove the connection cache even though the workspace deletion failed