Fix deadlock with many files to generate

If the queue filled up, then the one goroutine would block on that, and
the metadata generator would also be blocked on that lock. :-(