Solving the open XXZ spin chain with nondiagonal boundary terms at roots of unity