diff-tree: don't write headers if the diff queue is empty