Fixed JSON, XML and plain text default charset handling

Also made media type parsing more tolerant, a single invalid media type
won't invalidate the entire Accept header, and a single invalid
parameter won't invalidate the entire media type.