use proxy mode on vxlan interface only when l2-population is activated

the proxy mode was set by default on every vxlan interfaces
which leads to inaccessibility between VM that are not hosted
on the same host in a vxlan network

Closes-Bug: #1237082

Change-Id: I34028ee0bdfdccda61c6a29f58759259da060b68
(cherry picked from commit 345f8e1fdc65e0cf23369488d4318c0755d6b65d)
Fix IP recycling on exhausted pool

When recycling an IP, allocation pools are loaded with an inner
join with ip avaiblity ranges. However, if the pool is exhausted,
there will be no availability ranges and the query will return
no results because of the inner join. It will therefore be
impossible to reuse IP addresses once the pool has been exhausted.

This patch tries to reload allocation pools without joining on
IP avaiability ranges if the first query did not return any result.
Replacing an inner join with an outer join will not be possible
as postgresql backend does not support 'SELECT ... FOR UPDATE' with
outer joins (for more info see bug 1215350).

The patch also contains unit tests for verifying IP are recycled
correctly even when the pool is exhausted.

Bug 1240353

Change-Id: I87f274bd759cb47be77717f0760d3704f9f34ade
(cherry picked from commit 72af3cef2a476b7f1f7d109d1bd37cd50a6f560e)