Handle errors from Renderer._set_highlighting

It is done by moving appropriate get_highlighting calls into segment.py: here
errors from contents_func are handled as well.

This is a “fix” for #480 that will make such failures cause segment to disappear
with better header which should show segment which caused the error.

Closes #480
Merge pull request #1040 from ZyX-I/no-gradient-raise

Handle errors from Renderer._set_highlighting