Emit an explicit null check for some calls made out from gshared code.