special case permissions when creating `/opt`

or any other toplevel directory. Closes #4187
Merge pull request #4244 from rolandwalker/toplevel_dir_permissions

special case permissions when creating `/opt`