wildmatch: make dowild() take arbitrary flags