libsmbconf:registry: reorganize the validity check and canonicalization of the input...