Minor argsparser refactoring

This change separates the write creation / writing into a separate
function to make the code a bit more elegant.

It also removes the file because we occasionally run out of space in
/tmp
Seems like this comment should be associated with the original function?