rakefile: sanitize path checking (remove nils and duplicates)