Don't assume alarms are returned in insert order

The previous implentation of the tests assure than the db backends
return the alarms into the insert order. This is false for mysql.

The patch rewritte the tests to make it compatible to mysql

Change-Id: I146de0d8cef78b6c734bc6742238b939422645b9
Merge "Don't assume alarms are returned in insert order"