[history] Fix Swdb::getRPMRepo() to skip irrelevant RPMs.
[history] Fix Swdb::getRPMRepo() to skip irrelevant RPMs.

The method wasn't considering ti.action, which resulted in returning
repoid for the first RPM that matched by name rather than the actually
installed RPM.

Closes: #485
Approved by: j-mracek

hughsie/libhif,Conan-Kudo/libhif,Conan-Kudo/libhif,Conan-Kudo/libhif,hughsie/libhif,rpm-software-management/libhif,rpm-software-management/libhif,rpm-software-management/libhif,rpm-software-management/libdnf,rpm-software-management/libhif,rpm-software-management/libdnf,rpm-software-management/libdnf,Conan-Kudo/libhif,hughsie/libhif,rpm-software-management/libdnf,hughsie/libhif