Well what I end up doing was to spawn a process that cat the result in a temp file. Then pass a message to parent when child is done (basically a flag). Wait for this message and on getting the message, start another process to repeatedly copy the buffer and keep dumping stdout in a loop till done.
NOTE: For most cases, you have an option to change the size of exec buffer and and that should work as you could make it pretty big. I guess it can go to something like 1 or 2 MB but ya I am not sure on that.
Would be happy is someone got a better idea !!!
@Krasimir let me know how you solve it.