core: avoid deadlock in images

Currently the images table contains a foreign key to itself (quoting from
the table definition) :
    ...
    TABLE "images" CONSTRAINT "image_templates_images" FOREIGN KEY
    (it_guid) REFERENCES images(image_guid)
    ...

The column it_guid in the images table indicates what is the template
that the image is based on.

In postgres versions earlier than 9.3, when executing a update to a row
with a foreign key, a lock on the referenced record is taken which means
that we have a chance for a deadlock in the following scenarios:
1. Simultenous update to the template disks and to the disks of a vm
based on the template.

2. Simultenous update to disks of vms based on the same template.

This issue has been resolved in postgres 9.3
(http://www.postgresql.org/docs/9.3/static/release-9-3.html see
E.5.3.1.1), till we'll enforce usage of that version we can drop that foreign
key constraint which will also align it with the parentid column that we don't
a FK on as well.

Regardless of that, we should remove unneeded updates to images in
different flows.

Change-Id: Ib4939a716cef8901b53a90499201d815a4e3cb58
Bug-Url: https://bugzilla.redhat.com/1077715
Signed-off-by: Liron Aravot <laravot@redhat.com>