allow finalizing Env with Model to work around JuliaLang/julia#3067, thanks @lyro