CLOUDSTACK-4522: check before we do dynamic casting
CLOUDSTACK-3010: [VMWare] [SharedNetworkWithServices] router VM
deployment fails with error "Message: Invalid configuration for device
'2'."

ensuring that direct network guru assigns a mac address for the nic that
it designs
CLOUDSTACK-4466: Fix DHCP capability breaks in 4.2 for MidoNet

A recent code change in NetworkManager causes NullPointerExceptions when DHCP
capability list is null.

The commit which made the NetworkManager change also changed the VirtualRouter
to not use null for the capabilitylist, but didn't make this change for other
network devices, causing DHCP to fail on MidoNet.

This change also updates the MidoNet plugin to use the most recent MidoNet API.

Signed-off-by: Sheng Yang <sheng.yang@citrix.com>