A vanishing theorem for twisted Alexander polynomials with applications to symplectic 4-manifolds