More robust detection of empty UA in New()

Use strings.TrimSpace() to trim space on the userAgent parameter and
then check if it is an empty string.