DB: prevent inserting multiple jobs with same tag

The database constraint already prevents multiple jobs with the
same tag from being in the job table.  However the attempt to
insert a job which fails the constraint still leads to the
allocation of a job number when using MySQL's InnoDB engine.
Therefore check that the tag does not already exist before
attempting to insert a record into the job table in order
to avoid "wasting" job numbers.