Add fix for handling ring opening reaction

RDKit's does not support bond breaking/ring opening reactions. Thus we are
stiching products of such reaction using shared atoms. However, the solution
fails to work correctly in cases where bond ring atoms are match by different
product templates. Such bonds are lost. I added a function which scans
reactants for that kind of bonds and add them back to the stiched prodcut.