[layouts] Fix inefficient filtering in attribute tables
Set the expression filter on the request itself, rather than looping
through all features and testing on the filter. This allows providers
to hand off the filtering to the underlying datasource, and utilise
indices/etc where available.
(cherry picked from commit e3c1d18)