Close the key only if we have opened it (it's not the case when the subkey name is...