sort attributes for consistent output

Adds an override for ``startElement`` so that the attributes written in sorted order. This eliminates the arbitrary order of ``dict`` iteration while writing items attributes and provides consistent output. This was the source of issue getpelican/pelican#729 and getpelican/pelican#688.