Sync to_primitive() IPAddress support from Oslo

This enlightens to_primitive() that it may just call str() to
serialize netaddr.IPAddress objects.

We need this for NovaObject serialization through legacy interfaces
temporarily while we migrate things.

Related to blueprint unified-object-model

Change-Id: Ibdee90e4bbd337d541344977e2a689982e0a7d34