Fix attribute/namespace consistency between original and cloned documents in JRuby

Addresses #1034

Clear cached nodes when relinking namespaces
Remove attribute namespace when it matches the host element's namespace