Ensure the files are writable before deleting them during test initialization.

This solves cleanup issues when tests have failed and leave behind read-only files.