[C] More base64 encoding changes.  Use calloc instead of malloc in few places to simplify the code.