Fixes JRuby #1047 - incorrect test for whether a kw arg was provided.

Formerly, the code attempted to extract the argument value from the
hash of provided values and test it against nil. This fails in the
case of an explicitly passed nil. The new version instead tests
whether the hash contains the desired key.

Fixes #1047