core: DB - check if contraint exists before...

DB - check if constraint exists before attempting to drop it.

Check in the upgrade script that constraint exists before attempting to
drop it.
Since this fix must run also for Postgres 8.4.x we can not simply use
the 'IF EXISTS' clause for that constraint since that is supported only
from Postgres 9.x

Change-Id: I8356df36a53f06751779f7e221bdcf4b1dfa9de7
Signed-off-by: Eli Mesika <emesika@redhat.com>