libsmack: merge rules with the same subject and object before applying them