[SPARK-2010] [PySpark] support nested structure in SchemaRDD.

add API: applySchema(rdd, schema, f=None)

It need the new API to support nested structure.

It will do inferSchema() in Python, then convert the namedtuple() or other objects into 
tuple() (using dict currently). Before call SchemaRDD.mapPartitions(), It will convert 
the tuple into namdtuple, so user will access name fields like normal objects.

Because the type of returned data from collect has changed, so unit tests still failing, 
will be fixed later.
It's also not 100% clear to me that this will always work where the old PickleSerializer worked. Do you have a way to test it? If not, do we really need this for SQL?