filewrite: Add a missing break statement.
filewriter: set_metadata() must come before init_stream().  Also, fix a memory leak of the metadata object.