Expose a large number of ports should not slow down builder

Related to https://github.com/docker/docker/issues/9021

This improves the behavior of builder when handling a (large) list of ports by preallocating some data when possible. It improves the build speed of https://gist.github.com/karalabe/451f01479f8848973331#file-dockerfile from 20+ seconds to a few seconds on my machine

`EXPOSE` order now will also be more resistant to change as we sort the ports before saving them as image's config.

cc @erikh 
i think that's faster than the old way, but allocating a fixed length slice is still the fastest and `append` has some extra overhead. I wrote a sample program to benchmark here http://play.golang.org/p/dbG3JseujF