Fix double free on closing open project