implement resizing of primitive datatypes

This commit adds a resized datatype (the equivalent of
MPI_Type_resized). So far it only works for resizing primitive
datatypes. For this to work, a new pack function for primitive
datatypes had to be added, as the old one always assumes size=extent and
therefore copies incount*size chunks at once.