PGXL-3: GTM_WriteRestorePoint leaks file handle and fails on startup

1. Don't open the file unless needed
2. Prevent file handle leak
Merge pull request #7 from arcivanov/PGXL-3

PGXL-3: GTM_WriteRestorePoint leaks file handle and fails on startup (fixes #6)