Fix some overflow conditions on SmallInt

* Inspired by JRuby's conditions, but only changed the missing parts.
* We are using lots of undefined behavior here, with those *signed* ints.
* These corner cases are all due to std::numeric_limits<nativeint>::min()
  having no opposite (-min gives min).