Gets the current cursor position (line number).
Delegates to buffer. Updates cursor_line / cursor_offset in memory only.
Line number (0-based), or -1 if not available