After two deadly train crashes this year, Spanish Transport Minister Oscar Puente has said he will step down.