Finite-time future singularities in modified Gauss-Bonnet and F(R,G) gravity and singularity avoidance