Use ID for namespace generated by DB

In current implementation ID that is used in namespace to
insert data to DB is generated by built-in function - enumerate.
This causes problems with loading the metadata when there are already
namespaces in DB.

This patch removes 'enumerate' and asks for namespace ID
generated by database.

Closes-Bug: #1367771
Co-Authored-By: Bartosz Fic <bartosz.fic@intel.com>
Co-Authored-By: Pawel Koniszewski <pawel.koniszewski@intel.com>
(cherry picked from commit 89c04904416270d3c306d430f443a7127c5fc206)

Conflicts:
	glance/db/sqlalchemy/metadata.py

Change-Id: I235c6310077526cafb898ac007c3601b4d66c9fe
Merge "Use ID for namespace generated by DB" into proposed/juno