[java] [cs] manually follow in replace_mono to avoid infinite recursion (see #3024)
[cpp] keep stack in visit_type to avoid infinite recursion (closes #3024)
[TravisCI] update flex sdk version