Sam Cook took seven for 23 as Kent posted their lowest total at the St Lawrence ground but Essex only claimed victory by the skin of their teeth