A linear time direct solver for convex tridiagonal quadratic programs with bound constraints