[PATCH 7/9] reg/tests: Replace RegCloseKey() with the helper function close_key()