sysctl: improve the clearness of warning messages when writing keys
Set the proper errno if we don't have the write permission of the key or the path is a directory. Otherwise the warning message might be misleading.
Signed-off-by: Jiachen Zhang zhangjiachen.jaycee@bytedance.com