Linear almost Poisson structures and Hamilton-Jacobi equation. Applications to nonholonomic Mechanics