Fix pkgdb_get_pattern_query() for specifying origins