Only calculate excludeFilter if necessary

Prevents calling keys() on excludeIds when it is None
Fixes ZEN-15541

This fixes a logic error introduced in https://github.com/zenoss/zenoss-prodbin/commit/bcb4a0982c1efe9748743c853b0d4533aac9d31a