A lucky Diego Costa goal hands Spain their first win of the World Cup although dogged Iran came close to causing a major upset.<br />