Fixed a xbps_pkgpattern_name() crash and a test to reproduce it (found by Gottox).