Fix the sql query backup tool. Tested with postgres and sqlite.

git-svn-id: http://fusionpbx.googlecode.com/svn/trunk@3780 e2954ef0-caed-11de-bd98-e341d93cc3cc