ext/thin_parser: Use locale independent toupper()

thin fails when Accept-Language is equal to 'tr' due to the fact that
Turkish locale affects functions like toupper()/tolower() in unexpected
ways.

Problem lies in the fact that Turkish has different case mappings for
letters "I" and "i". A detailed explanation of the problem can be found
at: http://www.i18nguy.com/unicode/turkish-i18n.html

This commit converts ASCII character set to uppercase in a simple,
secure manner and then calls the original toupper() function.