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