E' un problema di buffer di output.

Se usi

codice:
fprintf(stderr, "Immediatamente ...");
non dovresti avere problemi.