work around memory leak ref JuliaLang/julia#9375