make record_metering_data concurrency safe

Recording metering might happen in parallel, and if two sqlalchemy
session try to create a source, a user, a project or a resource at the
same time, one of them fail with a IntegrityError.

This patch ensure the record_metering_data sqlalchemy session always
have the needed source, user, project and a resource by creating missing
obj in an other sqlalchemy session.

Fixes bug: #1237671

Change-Id: Ie8761ce1615c3142ad6ad2a400537f465f3bbf0a
Replace mox with mock in tests.api.v2

Change-Id: Id928855178d5bb69d6fc4edf159c4f5cdf633c4e
Fixes Hyper-V Inspector cpu metrics bug

Closes-Bug: 1249959

Change-Id: I39513648ab25d46b2639b24a94e7344954ce3aeb
Replace mox with mock in publisher and pipeline

Replace mox with mock in tests.publisher and tests.test_pipeline

Change-Id: I3ec2d16bb586c4265cb65414a9b5647832d903f2
Replace mox with mock in tests.collector

Change-Id: I4d8f8ec812a136f9e117535c98c4cbaa29791817
Imported Translations from Transifex

Change-Id: Ieeb3084892f6cfe3bdbf3b24068cb93b5d14ea80
Merge "Replace mox with mock in tests.api.v2"
Merge "make record_metering_data concurrency safe"
Merge "Fixes Hyper-V Inspector cpu metrics bug"
Merge "Replace mox with mock in publisher and pipeline"
Merge "Replace mox with mock in tests.collector"
Merge "Imported Translations from Transifex"