devc-con bug

Bug in devc-con, compile this program and run in console terminal
and pterm, in pterm all o.k., but in console terminal in first row
I got row blinked white on gray, while color of the second line is o.k.

Please try this program and anybody know how eliminate this bug ???

#include <stdio.h>
#include <curses.h>

int main()
{
int bg=COLOR_BLACK;
int key;

initscr();
start_color();

init_pair(1, COLOR_BLUE, bg);
init_pair(2, COLOR_CYAN, bg);

noecho();
nonl();

attrset(COLOR_PAIR(2));

addch(ACS_HLINE);
addch(ACS_HLINE);
addch(ACS_HLINE);
addch(ACS_HLINE);
addch(ACS_HLINE);
addch(ACS_HLINE);
addch(ACS_HLINE);
addch(ACS_HLINE);
addch(ACS_HLINE);
addch(ACS_HLINE);
addch(ACS_HLINE);
addch(ACS_HLINE);

refresh();

addch(ACS_HLINE);
refresh();
addch(ACS_HLINE);
refresh();
addch(ACS_HLINE);
refresh();
addch(ACS_HLINE);
refresh();
addch(ACS_HLINE);
refresh();
addch(ACS_HLINE);
refresh();
addch(ACS_HLINE);
refresh();
addch(ACS_HLINE);
refresh();
addch(ACS_HLINE);
refresh();
addch(ACS_HLINE);
refresh();
addch(ACS_HLINE);
refresh();
addch(ACS_HLINE);
refresh();


getch();

endwin();
}

This is a small ansi dump of program output:

0000000 1b 5b 31 3b 32 35 72 1b 5b 6d 1b 5b 3f 37 68 1b
…[1;25r.[m.[?7h.
0000010 5b 33 39 3b 34 39 6d 1b 5b 32 4a 1b 5b 48 1b 5b
[39;49m.[2J.[H.[
0000020 30 6d 1b 5b 31 32 6d 1b 5b 33 36 6d 1b 5b 34 30
0m.[12m.[36m.[40
0000030 6d 44 1b 5b 37 62 1b 5b 33 39 3b 34 39 6d 1b 5b
mD.[7b.[39;49m.[
0000040 31 30 6d 1b 5b 32 35 3b 31 48 10m.[25;1H

0000000 ESC [1;25r ; Set scroll region and home cursor (row=1, col=25).
0000007 ESC [m ; Select Graphic Rendition.
000000A ESC [?7h ; Private set mode to 7 (Auto wrap on).
000000F ESC [39;49m ; Select Graphics Rendition (39 - set fg, 49 set
bg).
0000017 ESC [2J ; Erase whole screen.
000001B ESC [H ; 7bit codes for HTS.
000001E ESC [0m ; All attributes off.
0000022 ESC [12m ; Enter PC higher charset.
0000027 ESC [36m ; Set FG color to Cyan.
000002C ESC [40m ; Set BG color to Black.
0000031 D ESC [7b ; Print D and repeat symbol D from higher charset
(’-’) 7 times.

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Bug here !!!

0000036 ESC [39;49m ; Select Graphics Rendition (39 - set fg, 49 set
bg).
000003C ESC [10m ; Exit alternate charset.
0000043 ESC [25;1H ; Set cursor position to row=25, col=1.