Yep. I did the intuitive interactive thing. I fear your problem is pretty standard for stdio buffered programs looking for a newline.
Code:
@skbsd::~/src>./progname
call number 0
still in loop and finished = 0
call number 1
still in loop and finished = 0
call number 2
still in loop and finished = 0
call number 3
still in loop and finished = 0
call number 4
still in loop and finished = 0
call number 5
still in loop and finished = 0
qcall number 6
qcall number 7
qcall number 8
qcall number 9
qcall number 10
<\r here>
still in loop and finished = 1