Get the first scheme received in HTTP_X_FORWARDED_PROTO header.

....
@brianr fixed and added tests.