Rewrite the conversion functions between strings and SQL_NUMERIC_STRUCT.
Aside from making the functions more readable and faster, this fixes
a number of bugs:
1. When converting a large number from decimal to binary, the least
significant byte might be wrong (reported by Walter Couto)
2. In binary->decimal conversion, a number with small precision but large
scale caused a "Floating point exception".
3. In binary->decimal conversion, building the final string was wrong, picking
up "digits" from outside the reserved stack space, if scale was larger than 40
4. The param_string buffer allocated for the result of binary->decimal
conversion was too small.
Also add a test cases for all of these bugs.