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.

Change-Id: I235c6310077526cafb898ac007c3601b4d66c9fe
Closes-Bug: #1367771
Co-Authored-By: Bartosz Fic <bartosz.fic@intel.com>
Co-Authored-By: Pawel Koniszewski <pawel.koniszewski@intel.com>
Merge "Use ID for namespace generated by DB"