Colchester have agreed a deal for Portsmouth defender Josh Thompson