simple utility function to write files in tmp files and have python clean up after itself.