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