Script: Fix handle leak with unclosed script file