base58: add paranoid return value checks

Always clear buffers and check return values.

Necessary?  No.  But IMO it makes things slightly more readable, while producing the same compiler-optimized end result as alternatives.  The compiler generates a temporary for the direct result of each function/method call, in any case.