[PATCH v6 3/5] kernelbase: Factor out the common parts of open_key() and create_key().