Clicks at end of chirp signal
From the code in Olli's comment, the phase is going to be 

beta = t1 / log(f1 / f0)
phase = 2 * pi * beta * f0 * (pow(f1 / f0, t / t1) - 1.0)


So to ensure you have a zero crossing at the end of your signal, you need to choose a combination of t's end value and t1 for which the phase is modulo $2\pi$.

From your code, the last value of t will be 44099/44100. So the beta value is:

beta = 1 / log(1000)


and the phase of the last sample in the signal will be

phase =  2 * pi * 1/log(1000) * 20 * (pow(1000, 44099/44100) - 1.0)


which will be close to modulo $2\pi$ if you have a ratio of f1 to f0 equal to 1000.007748 instead of 1000 (after a bit of playing in Excel).  Try setting f1 to 20000.15495 instead of 20000.

EDIT : I made a mistake in the above and have corrected it. Here's a Google Doc that has the spreadsheet I've used (read only) for the correction.

Screenshot highlighting the close values below.