TheBerkin/SharpTalk — pull request #5 by Tamschi (2014-05-02 23:06:48+00:00)
Title: Fix for the buffer queue build-up

I noticed the buffer queue issue still exists, so I did this quickly with the online editor. (It's untested.)

The BufferRaiiHelper is never boxed (despite the specification saying otherwise), so the using statement really is almost just a shortcut for

```C#
ReadyBuffer();
try
{
...
}
finally
{
FreeBuffer();
}
```

, which should in theory ensure there are never any leaks of pinned memory. There's a small difference in behaviour as the buffer is not kept while unused and a new one is instantiated for every high level call outputting to memory.

This change is under the assumption that the buffer queue is emptied after the P/Invoke calls.
I probably chose the using block a bit too large, so feel free to move its end up by a few lines. Freeing the buffer directly after `Sync()` should work, I think.

Adding a similar mechanism for `TextToSpeechOpenInMemory`/`TextToSpeechCloseInMemory` is probably a good idea since right now there is no immediate guarantee for returning the engine into its default state if an exception occurs between the two calls.