Fix parse_options_header to handle RFC2616/RFC7231

The current version of the function does not handle correctly the
multiple MIME type version of the header as described in RFC2616 and
RFC7231. This patches fixes that. It also fixes #404 at the same time.