Fix: open locked file on windows during data_bag update

The current open() calls were locking the file and causing the write() to fail on Windows. New files were not affected by this issue.