Fixes for #114.

Where relevant, tokens are obtained in a loop with an increasing buffer size as long as SEC_E_BUFFER_TOO_SMALL or SEC_E_INSUFFICIENT_MEMORY is returned.