lib: use strlcpy() instead of strcpy()

This reverts back 27faad4fd79399eda8811d4315c96317ed47a151 but we
introduce a variable for the value of strlen()+1 to make it clear we know
what we are doing.