Lattice investigation of the tetraquark candidates a0(980) and κ