UK's top anti-terror officer resigns after blunder