fix #18051 and #18106
This is more or less a rewrite of the code, I hope I didn't introduce too many new problems.
always consider all ways with matching tag when calculating unconnected nodes
for partial tests filter the calculated errors (this means a small additional delay for this test when uploading data)
fix recursion problem in isConnectedTo so that it doesn't stop too early
remove code which excluded eg. ways with highway=cycleway + railway=abandoned or waterway=river + boundary=administrative
improve performance, esp. use HashSet when calculating types of nodes in method addNode() and QuadBuckets only when searching is done. Together with other changes this reduces runtime by ~50%, so I hope the delay for the upload is not too high.