fix: close figures when using spm with mcr

force close invisble figures when using spm with mcr