Replace dodgy use of const char* and memcpy with std::string.

This was backported from commit e01df63 in master.
Kill some logically dead code detected by Coverity.

- m_watch: wl has already been confirmed to not be NULL on L161.