fixes #5489 - don't generate empty search () filters on permissions migration

Please see http://projects.theforeman.org/issues/5489 for a reproducer.

@ares or @eLobato please review :)