SERVER-11099 Partial cherry-pick from upstream v8 to fix UB related mongo shell crash

This is a backport of the portion of https://github.com/v8/v8/commit/b3775cf3
relevant to our vendored version of v8. Please see that commit for more
details on the nature of the undefined behavior and how this change fixes it.

This will repair the issue with the mongo shell crashing on shutdown
when compiled with clang-3.3 or newer.

(cherry picked from commit 670c981819ed1512b9f623d3879901dda606ed20)
Merge remote-tracking branch 'upstream/v2.4' into v2.4