Avoid O(N) separate queries in peek_perms

It was doing a separate query per module to get the owner.  Instead get
the owner in the initial query.

Join against first-come for the co-maint case, and fall back to a
separate query only if the module is in the modulelist but not in
first-come (about 1k modules at the moment).