Layer fields should be updated after changes in the data provider.

After modifying a layer's fields in the data provider the cache of the fields in the layer need to be updated as they are not automatically propagated.

This commit adds a comment and code example to this effect in the pyqgis cookbook in the section on modifying vector layers.