Allow the output file to be stdout

Remove the need for seeking when writing the elf file and default to stdout
if an output file is not supplied.