C++: Provide fallbacks for missing stoi/stod functions

Notably, Android does not provide these functions.  The fallback
implementation is based on the one in the GNU ISO C++ Library.