Database deadlock error
We got a deadlock in "report_declared_files", which, after discussing with Robert,
would appear to be caused by updates to the job_files table trying to put read locks on the attached "job" rows; but of course we have update_job calls going on periodically as well, which get with_for_update locks on the "job" table rows.
So I've patched it for now to try to get read locks on the Job rows first, and then try to update he "job_files" entries. I also noticed that this routine never got split out of poms_service.py, so I moved it into FilesPOMS.py while I was at it...