[jit] Fix gshared and aot support for --debug=casts.