[misc] Make string conversion functions to set *ptr_to_len...

... even when input string is NULL.
[misc] Do not convert NULL strings into "".

This breaks some checks in mCtrl for string conversion errors.
Also trace out GetLastError() when a conversion fails.
[misc] Add proper error checking into the in-buffer string conversions.