registry: untangle assignments and if statements in regdb_set_secdesc().