Write/create/truncate prototxt when saving to fix #341

Create the output file if it doesn't exist or overwrite it if it exists with content when saving a prototxt and set permissions to owner all and group + other read.

One could overwrite a prototxt this way, but such is the peril of saving files.

This will cherry-picked to master or a new release will be made soon enough to fix the problem there.