Fix removal of stream aliases when a file is closed for Lean Prolog