Fix $.isObject() and condition in attr()

This allows $(selector).attr('attribute', null) to correctly
remove an attribute from a collection of elements.

Fixes #349