spacemanager: Fix case statements in db triggers

Apparently CASE throws an exception if a branch is missing. Since
there is no noop statement and thus adding an empty else line isn't
possible, I changed the CASE to chained IF statements.

Also added missing DROP TRIGGER IF EXISTS statements prior to all
CREATE TRIGGER statements - otherwise applying the changeset a second
time (after having modified it) will fail.

Target: trunk
Require-notes: no
Require-book: no
Acked-by: Dmitry Litvintsev <litvinse@fnal.gov>
Patch: http://rb.dcache.org/r/6492/