Shift-and-invert Krylov methods for time-fractional wave equations