Changelog:
- added key file protection for Windows OS
- standardized calls to protect files
- removed temporary file deletion in temp_fstream::open for UNIX