Better error message when the write permission are missing in the local directory

Fixes #1394