Check that $_SERVER[ 'HTTP_USER_AGENT' ] is nonempty

$_SERVER[ 'HTTP_USER_AGENT' ] can be set to null, in which case the resulting
event fails validation, since null does not have type string. This doesn't
happen often, but we should catch it.

Change-Id: I89819bd943ddbbb959c12b768b76f02d3d1140c5