$\renewcommand{\Re}{\operatorname{Re}}\renewcommand{\Im}{\operatorname{Im}}$Another way to phrase the derivation of @Latrace and @Gonenc, maybe more physically, is to recognize that the Wronskian which appear is just the probability current.
$$j = \frac{\hbar}{2mi}(\psi^*\partial_x \psi -(\partial_x\psi)^*\psi) = \frac{\hbar}{m}\operatorname{Im}(\psi^*\partial_x\psi)$$
Note that this is $j = \frac{\hbar}{2mi}W[\psi^*,\psi] = \frac{\hbar}{m}W[\Re\psi,\Im\psi]$.
Then, we have, in a general state $\psi$ :
$$\langle \hat p\rangle_\psi = m\int_{-\infty}^{+\infty} j(x)\text dx \tag 1$$
As probability is conserved, we have, for a general solution $\psi(t)$ of the Schrödinger equation :
$$\partial_t |\psi|^2 + \partial_x j = 0$$
For a stationary state, $|\psi|^2$ is constant everywhere constant in time, so we have $\partial_x j = 0$ (This can also be checked explicitly from the time-independent Schrödinger equation).
For a bound stationary state, the fact that the wavefunction must falloff at infinity implies that $j= 0$ : the probability current vanishes (as we expect for a bound state). From $(1)$, we then have $\langle \hat p\rangle_\psi =0$.
For a scattering state, there is no normalizability condition, and indeed we can have $j\neq 0$. More precisely, for any $E>0$, we have two solutions with $j = \pm \sqrt{\frac{2E}{m}}$ (corresponding to plane waves $e^{\pm i x\sqrt{2mE}/\hbar}$ near $x \to -\infty$). Then, $\langle \hat p\rangle_\psi$ diverges.
This is the flaw in @user26143's reasoning : scattering state are not normalizable, and therefore we should'nt expect $\langle \psi|\hat p|\psi\rangle$ to be finite. If it is not finite, then the calculation does not work.