Fix mkdir exception when closing the env (#3280)
Fix mkdir exception when closing the env (#3280)

* fix mkdir when dir already exists

* fix indentation error

* address review

DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core