Close IFormatReader copy if not to be used

The generated copy from Memoizer's loadReader logic
was in some cases not being used. When the null was
returned, a RandomAccessFile held by the reader was
left open.
Also close on java.lang.Error
Merge pull request #1196 from joshmoore/memo-close-copy

Close IFormatReader copy if not to be used