Vector and scalar charmonium resonances with lattice QCD