[Bug Fix] Added os.O_EXCL flag to make sure existing files are NOT overwritten

the current version will open existing file and possibly truncate it, O_EXCL will make sure that if the file already exists, do nothing with it.