add root/checkedint.h and .c

This is a direct translation of druntime's core.checkedint to C++. The idea is to replace the several ad-hoc overflow checks in dmd with these. Even includes unit tests!
This is the hackery I was referring to.  Why can't you use the existing definitions?