Remove stale chunks when failed to update image to registry

For image v1 api, the operation of uploading image bits to store and
the operation of updating image metadata are separaed, so when the
second operation failed, the image stale chunks will be leaked in store.
This change added a logic to remove those chunks if an exception
happenned during the step of image metadata updating. And if
glance-registry could be reached still, the image status will be changed
to 'killed', this followed standard glance image status transition.

Closes-bug: 1254497
Change-Id: I01e13066b48a8feb1ead0de64992e7997feafdea
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Merge "Remove stale chunks when failed to update image to registry"