allow writing attributes with write-only perms

* replace "r+" with "w" in fopen() flags to avoid EACCES when
opening attribute files with no read permission.
Merge pull request #1 from gizero/fix-EACCES-in-local_write_dev_attr

allow writing attributes with write-only perms