Fix calling unicode_to_ansi_copy() in SQLDriverConnectW
Fix calling unicode_to_ansi_copy() in SQLDriverConnectW

There are more problems related to buffer lengths:

1. unicode_to_ansi_copy() in its first argument (in_str) expects single
   byte output buffer (SQLCHAR), in its second argument length of output
   buffer and therefore passing length of this buffer based on
   sizeof(SQLWCHAR) is wrong and does not make any sense.

2. unicode_to_ansi_copy() in its third argument (conn_str_in) expects wide
   character input buffer (SQLWCHAR), in its fourth argument number of
   characters in input buffer and therefore increasing this length would
   just lead to memory corruption (reading memory after end of allocated
   array).

3. wide_strlen() returns number of wide characters in null-terminated wide
   character buffer. Therefore doing sum of sizeof(SQLWCHAR) and number of
   characters does not make any sense. sizeof(SQLWCHAR) return bytes, not
   number of characters.

This patch fixes these problems with following changes:

1. Calculate length of output buffer (in_str) correctly, use number of
   characters in input buffer (conn_str_in) increased by 1 for null-term
   byte.

2. Do not touch length of input buffer (conn_str_in). When length if
   specified as SQL_NTS, calculate it via wide_strlen().

3. Remove nonsense sizeof(SQLWCHAR).

kadler/unixODBC,lurcher/unixODBC,kadler/unixODBC,kadler/unixODBC