Avoid intermittent integrity error on alarm creation

Fixes bug 1255107

Previously, alarm created failed intermittently with the
sqlalchemy driver, due to the reliance on session merge to create
the project & user IDs if not already encountered.  This approach
conflicted with the strict foreign key constraints that were
added to the alarms table as an after-thought.

Now, we avoid the potential problem by creating the project and
user IDs explicitly.

Unfortunately, this cannot be tested via the scenario tests,
as there we use sqlite (the problematic migration does not
apply the foreign key constraints for that engine).

Change-Id: Ieaed676a0a68725242fadbf658646b874d6851ce
(cherry picked from commit b2b500c83cf5a81269c84a16f9a30ab7fa4c8ee6)
Merge "Avoid intermittent integrity error on alarm creation" into stable/havana