C fgets_line of arbitrary length
Do not put the sentinel characters in every iteration. Set them before the loop, and after a successful reallocation.
Also, (*line)[*capacity - 2] = 0; is redundant. Indeed, if (*line)[*capacity - 1] remains 1 we don't care, and if it turns to 0 then (*line)[*capacity - 2] has been overwritten anyway.

goto is totally unwarranted. break works very well.

Do not handle fgets failures inside the loop. Break immediately.

Using position as an index, rather than the pointer, seems cleaner. Consider
  fgets(*line + position, *capacity - position, stream)

etc.