Copy add_function() context buffer

Copy the add_function() context string buffer instead of maintaining a
reference to it.  This allows the Perl reference to the buffer to go out
of scope without affecting the worker.