Suspected Islamist 'may have helped foil UK attack'