Include null terminator in string recorded by Task::record_remote_str.

This fixes a regression introduced by commit 2ccd42.