Fixes #1943 by updating UserAgent handling for download statistics

I've already applied this to production after testing it.