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

fixes #6 
1. Don't open the file unless needed
2. Prevent file handle leak