Fix string conversions functions to throw out_of_range properly.  Fixes http://llvm.org/bugs/show_bug.cgi?id=14919.