NSX: fix bug for flat provider network

The flat provider network would cause an exception when writing to
database. This is due to the fact that the DB expected an integer
and received an object instead.

Change-Id: Ib9d38711c0c2ef16d8bf74bfae44864a1bc272b1
Closes-bug: #1324120
(cherry picked from commit 84dfaa8a87cce660aa20619bd93263e645bbb2d0)
Merge "NSX: fix bug for flat provider network" into stable/icehouse