Don't crash for an empty user agent string.

Sadly I never thought of this case before... Thanks @edhgoose for the bug
report. Fixes #7.