Cleanly fail when location URI is malformed

At the moment when a malformed URI is passed at either image creation
or update Glance fails with an Error 500. This commit allows Glance
to fails cleanly with a 400 BadStoreUri.

Change-Id: Iffe9be3b65758d18c7e7f96b3ceb3399b9748b63
Closes-bug: #1257498
V2: disallow image format update for active status

The V2 API doesn't not allow empty `container_format` and `disk_format`
when creating a new image.
Currently, it is possible to update these properties after data have
been saved to the image which is contradictory with the previous
statement.
This change disallows modifications of these properties for images with
a status different than `queued`.

Change-Id: I98c22197ba6d96470976718d48ac53748a19ffc6
Closes-Bug: #1249412
Merge "Cleanly fail when location URI is malformed"
Merge "V2: disallow image format update for active status"