Make AppendSamples locking more granular.

Change-Id: Idad010a5e2f3e1855290841da55130151c7ed572