KAA-177: Implement basic logger for C SDK.

Reviewers - Andrey Panasenko and Taras Lemkin.
Close the user sink, if it was used.