Close the implicitely opened registry key.