Fix #1109. Clear the XPath cache when an attribute is removed

This is a fix for #1109. I'd like someone to eyeball since it introduces some changes to the ruby side of nokogiri to conditionally define `remove_attribute` in MRI only. Under JRuby `remove_attribute` is defined in the Java code and the code was being replaced with the ruby version.