orm: Fix issues surrounding MySQL commands OoS

Several places in the code initialize a list of objects from the database
and only fetch one item. In certain instances (which seem almost like a race
condition), MySQL will feel like there are more records available in the
database and will complain with "Commands out of sync, you can't run the
command now".

This patch addresses the issue by utilizing the ::one() method of the
QuerySet where only one record is expected. The ::one() method is further
designed to fetch all one results (which satisfies the MySQL client library)
and return the first item.
Merge pull request #1012 from greezybacon/issue/orm-mysql-oos

orm: Fix issues surrounding MySQL commands OoS

Reviewed-By: Peter Rotich <peter@osticket.com>