builder: allow more empty lines in index files

Improve the index grammar to allow more than one empty line between
sections, and to allow any number of empty lines at the end of the file
(after the last section).