Avoid noise in compressed samples

Padding the sample with one repetition of the loop instead of noise improves the shape of the wave function, avoiding noise in the final sample. See http://musescore.org/en/node/34151
An even better solution would be to pad the whole final chunk (array of length 2048) with repetitions of the loop, but the solution in this PR already works.