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.
Fixed unit test CMakeLists.txt

Change-Id: Ib6f431ecc26e771ad18fb16118fe047eec8b734f