Reject trailing whitespaces in IP address

Trailing whitespaces in IP address or CIDR pass API validation. These
whitespaces sometimes cause serious troubles. For instance, a trailing
CR code in allocation pools cause an ovs-agent to crash when calling
iptables. In this case, a tenant user's operation mistake affects whole
system.

By modifying _validate_no_whitespace() to reject data with whitespaces
in the beginning and the end, the IP address and CIDR validation
detects invalid attributes. The MAC address validation already rejects
these whitespaces.

Change-Id: Id4589236cfd44c2fd5956c5ab4ab6871381a0c34
Closes-Bug: #1393329
Merge "Reject trailing whitespaces in IP address"