Preallocate memory before samples are received.

Preallocating memory for samples when a capture is started improves performance during the capture, as realloc() is called only once.