Fix race condition of resize confirmation

Currently, the db update of migration status is after the db update of
instance's vm_state in _finish_resize, so a race condition occurs when an
instance's vm_state is updated but the migration status doesn't, and at
this moment a resize confirmation is performed, then an exception
'MigrationNotFoundByStatus' is raised.

Fixes: bug #1066140

Change-Id: I1dac98cc99d3491c92faaad2b9dcc40d7c0524b5
Fix error in test_get_all_by_multiple_options_at_once()

We should not use 0 as id. It will conflict with db-unique-keys.

Since soft_delete() stores `id` value in `deleted` column, and
checking whether entry is deleted softly is made through comparison of
`id` and `deleted` column values, created entry will look like already
deleted softly.

blueprint db-unique-keys

Change-Id: Icb7a4880886301a3cc72c6ea0e455b867952812e
Merge "Fix race condition of resize confirmation"
Merge "Fix error in test_get_all_by_multiple_options_at_once()"