canvas.lua: Fix up lookup_host and fix segfault of url insertion.