This effectively reverts the commit 2a394d0b. But drop trailing '\r' of the read value, as sd_device_set_sysattr_value() drops it. Fixes #20025. (cherry picked from commit 70160c6e)