On the three-dimensional stability of a solid-body rotation flow in a finite-length rotating pipe