Add example of passing argument to thread function

Instead of implicit conversion of the pointer to the buffer into the
std::string object we cast it explicitly, so we have not UB due to
addressing destroyed array.