Spark plug state detection