Retry on DB deadlock timeout errors

When deleting ports and networks concurrently, because of
known incompatibilty of eventlet and MysqlDB, DB deadlock could
occur, causing API to fail.  The proper fix for this would be to
make all APIs non-blocking, and/or use an eventlet-compatible
MySQL library like mysql-connector.  Until such proper fix is in
place, simply retry on such error to avoid API failure.

Change-Id: I5c2a3c89c494917947a2d1d6163b87a3b8c6d1c6
Fixes: MNP-11