grep: use set instead of dict with dummy value

Authored by martinvonz.