Fixes #2748, Field-Notes export does no longer work

Corrected close order for writer and buffer