base58: add paranoid return value checks

Always clear buffers and check return values.

Is the intermediary rc58 variable necessary here?