Skip polling when all hosts were skipped

Fixes #1823.