Fix wrong hash usage when adding licenses.

pkg_addlicense function tried to search for a license in files hash
instead of licenses hash causing thus memory corruption in a general
case.