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