fix: Restore missing changes to v4 of go runtime by jimidle · Pull Request #3871 · antlr/antlr4

I had not though about this, but I guess some of the fix PRs did not have one fix
that was in the legacy version of the runtime, copied in to the v4 branch. This
commit fixes that.

Signed-off-by: Jim.Idle <jimi@gatherstars.com>