more sophisticated all.equal.environment(): no longer "simple" infinite recursions

git-svn-id: https://svn.r-project.org/R/trunk@66640 00db46b3-68df-0310-9c12-caf00c1e9a41
new R_has_methods_attached()

git-svn-id: https://svn.r-project.org/R/trunk@66641 00db46b3-68df-0310-9c12-caf00c1e9a41