Use locking in assign_tasks_to_agent
Use locking in assign_tasks_to_agent

We were experiencing some parallelism problems where two or more
instances of assign_tasks_to_agent were running at the same time for the
same agent and ended up assigning more tasks than they should for that
agent.

In theory, database transactions should take care of that, but somehow
they don't.  Weird.

pyfarm/pyfarm-master,pyfarm/pyfarm-master,pyfarm/pyfarm-master