rectangle_pack: improve auto resize behaviour

It now starts over with a larger size if the rectangle can't fit. This
has a slight overhead (measured around 26 milliseconds with 1286
rectangles), but it wastes no space.

Alternatively we could just resize the free areas at the edges of the
rectangle pack. It's infinitely faster but wastes space.