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 #1211 from joshmoore/rebased/develop/memo-close-copy

Close IFormatReader copy if not to be used (rebased onto develop)