Fixed #13518 - Added FILE_UPLOAD_DIRECTORY_PERMISSIONS setting

This setting does for new directories what FILE_UPLOAD_PERMISSIONS
does for new files.
Made changes requested by timo

- Wrapped os.makedirs/os.umask in try:finally
- Updated docs for version 1.7