Deadlocks and random CI tests failures are fixed

Code partially refactored to proper use of DB transactions:
 - receiver partially refactored from DB models to Nailgun objects
 - locking of objects added into reveiver
 - task manager partially refactored
 - DB commits removed from receiver
 - weird DB commit removed from Nailgun task object
 - weird logic for repeating tests on deadlocks removed
 - in fake tasks reveiver methods calling wrapped by try/except
 - filtering of empty collection in NailgunCollection fixed
 - ordering by id added into getting Task object by uuid in case of locking
 - values from consts module used instead hardcoded values in many places

Implements blueprint nailgun-db-transactions
Closes-Bug: #1340703

Change-Id: I520efc9a4b0b52feae4b86309da653ade50c7c9c
Merge "Deadlocks and random CI tests failures are fixed"