handles MP_BUF in mp_error_to_string (cherry picked from commit a825e0a3601f81ddf1a6753c45e5b74d44c23d78)