Backport from DB API changes functionality to set table name.

This would allow the use of the new syntax i.e.:

-$t_query = 'SELECT COUNT(*) AS unused_user_count FROM ' . $t_user_table . '
+$t_query = 'SELECT COUNT(*) AS unused_user_count FROM {user}

Whilst still allowing use of the old syntax, to give developers and plugin
authors the opportunity to start migrating code to the new syntax ready
for the 2.x.

By doing this, it also helps us extend the life of 1.3 - as it stands, if we
release test versions of mantis with the new DB layer about within a month of
the final 1.3 release as previously agreed, we could reach the stage where we
have support issues from our side for the 1.3 release.
Update commit following Damien's comments.