motd: rewrite sysctl_get function for better python 3 support