What is the domain of the linear momentum operator that you're looking at? You can't just look at arbirary wave functions, because then ##\psi_b^*\psi_a\vert_{-\infty}^{+\infty}## will not be zero. You need to restrict to special wave function which do have that property.
Another solution is that you use "distributional differentiation".