Fix crash when buffer is not yet created

Qt clients usually create and attach the buffer after add_surface() is
called so we can't rely on it.

As soon as there's a buffer geometry is updated though.