Fix CSR1kv router service plugin REST failures due to DB lock timouts

The existing implementation did some operations during DB transactions,
which could lead to deadlocks and timeouts.  This patch changes the
implementation so that those operations are performed outside of the
DB transactions.

Change-Id: I4597b1a84a4077fd2f22fb0c371b2894304f4276
Closes-Bug: #1398433
Merge branch 'bug/1398433' into harp/csr_hotplug

Change-Id: Ia3cb56f107c4f27271606f54869a14f9c11cb25e