Restore files permissions on unix like systems (linux, mac os x).

* Restore files permissions on unix like systems (linux, mac os x).
* Added retries on fs.chmod to avoid errors while restoring permissions.

WARNING: this is a temporary fix which uses synchronous methods.
The real synchro mechanism to implement is not yet understood.

Enyo-DCO-1.1-Signed-off-by: Yves Del Medico <yves.del-medico@hp.com>