Do cleanup of DeploymentUnit references

- this fixes few memory leaks that could occur on re-deployment