Viscosity solutions of Hamilton-Jacobi equations in infinite dimensions. IV: Hamiltonians with unbounded linear terms