Don't write to disk with --stdout

This was identified as a bug in #355