Construct a period set from an array of periods and free the array and the periods after the creation.