Make merge_kwargs case-insensitive when looking up keys.
Retrieve kwargs.keys() just once.
Merge pull request #1092 from jianlius/case-insensitive-update

Make merge_kwargs case-insensitive when looking up keys.