Replace IS_UDP macro with a function

Clang emits warnings about too many parentheses.

Change-Id: I32a457c6a8404c8630a33e8d5b2b596f3c98c877
Reviewed-on: http://review.couchbase.org/32677
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>