I=1/2 S -wave and P -wave Kπ scattering and the κ and K* resonances from lattice QCD