Fixed bad serialization in C++03.

In C++03, ```resize()``` member functions copy-construct from one object to other objects. This behavior causes unintentional sharing. An example: http://melpon.org/wandbox/permlink/lLjKT5gt7wYjjCQ8
This line is not passed in unittest because input v.size() is zero. I think it should be tested.
list and vector are too.