Preserve mode when using inplace filters that use a temporary file.