As is documented, write_po function renders two blank lines at the end of the file. GNU gettext documentation about PO files does not specify that this is mandatory.
I think that this makes no sense, but maybe something could explain why this has been the choice. It creates inconsistent output in diffs, uneeded extra space in disk, and so on... it is just a bad practice for text files.