libstd: convert chained ifs to a match in base64.
auto merge of #6332 : huonw/rust/std-base64-match, r=nikomatsakis