Fix GC steps threshold handling when called by JIT-compiled code.

Thanks to Cheng, Long.
Merge branch 'master' into v2.1
Fix for last commit
Merge branch 'master' into v2.1