Add a workaround for gfortran bug 64244

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64244 for more details. If
GNU_64244 is defined, we remove the non_overridable keyword. This workaround is
not ideal, as it causes Fortran to generate the virtual function table so
things will be slower, but at least it compiles.
Add a workaround for gfortran bug 60289

There does not seem to be a way to allocate the array of character(:) if the array
is defined as class(*), so we simply return an error for this case if GNU_60289
is defined. We define it for gfortran.