Improved parsing of distribution versions

try_cleanup_distro_version now returns a parsed_version, which ensures
that the result is a valid version. It's now also more generous in what
it can parse.