Backport some Infinispan compatibility improvements

- https://hibernate.atlassian.net/browse/HSEARCH-1672