Treat language as BCP 47 tag for Graphite fonts

OpenType language tags are full of idiosyncrasies and do not map well to
other standards, but we need to keep treating the language option as
OpenType tag for backward compatibility, but this is not a concern for
Graphite so we treat it differently when /GR modifier is used.

Based on patch from Martin Hosken.
Plug more memory leaks