vfs: introduce helper function to safely NUL-terminate symlinks