Tree-based Dialogue Reinforced Policy Optimization for Red-Teaming Attacks