spacemanager: Fix link group overallocation trigger

There is a database trigger that should prevent overallocation of link groups.
Over allocation can of course not be prevented as pools may go offline at any
time, but we can avoid that space manager increases its allocation beyond what
is available at a given moment in time.

The trigger fails a link group update if the available space is negative and
the amount of reserved space increases. This should allow reservations to be
decreased in size even when space is currently overallocated due to pools
being offline.

The existing check however fails for the use case of flushing files to tape:
The space consumed by flushed files is released back into the reservation. This
causes the reserved space in the link group to increase, but so does the free
space and the available space should thus be the same. The check however only
looks at whether the reserved space increases - not whether available space
decreases.

Fixing this as a trigger on linkgroup update turned out to be impossible.
Instead the patch updates the srmspace triggers. A conditional update of the
link group table is used, with a check for how many rows were updated.

srmspace update is now restricted to not move spaces between link groups. This
simplified the trigger at the expense of a usecase we don't have at the moment.

Target: trunk
Require-notes: no
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/6519/