Handle PermissionError in os.chmod Call - Update engine.py (#4139)
* Update engine.py
This branch includes changes to handle potential exceptions that may occur when attempting to change file permissions using the os.chmod function within the DeepSpeed engine. The specific issue addressed is the PermissionError that may arise when working with certain filesystems or under restricted permissions.
* Change to use logger
* Split permissions out and add unit test
* UnitTest(use DistTestClass) + trailing whitespace
* update unit test
* UT parametrize 1, 2 ,3
* trim white space from unit test
* change to PermissionError
* run pre-commit formats
* Catch FileNotFoundError & PermissionError