PR libfortran/20163 * io/open.c (st_open): call library_end() before returning even if an error arises. * gfortran.dg/pr20163-2.f: New test. From-SVN: r97153