Check error returns from write to sysfs

Add helper function to check write to sysfs files.
1 file changed