Store pending messages in list.

This avoids copying elements around as they are added to the back and fetched from the front.