tolerate case where head or path is empty

Without this check, a call to client.log() without a path
causes parents to be prefixed with a colon (and empty head)