Barty Crouch Jr. likely didn’t know.
It’s not clear if Barty Crouch Jr. knew about the curse on the Defense Against the Dark Arts teaching post, but he likely didn’t. It’s unlikely that anyone would have told him, and having spent so long under his father’s control, it’s unlikely he’d have known about it on his own.
The Dark Lord mightn’t know he cursed it.
Though Dumbledore confirms that the Defense Against the Dark Arts teaching post was cursed, it’s not clear that the Dark Lord actually had intentionally cursed it and was aware of the curse himself. Since the Dark Lord never cursed any other position that he might want to make it difficult to fill, and he put two people who would serve him in the position, it seems possible he might not have cursed it intentionally.
“Was he after the Defence Against the Dark Arts job again, sir? He didn’t say …’
‘Oh, he definitely wanted the Defence Against the Dark Arts job,’ said Dumbledore. ‘The aftermath of our little meeting proved that. You see, we have never been able to keep a Defence Against the Dark Arts teacher for longer than a year since I refused the post to Lord Voldemort.”
- Harry Potter and the Half-Blood Prince, Chapter 20 (Lord Voldemort’s Request)
It seems entirely possible that the Dark Lord’s curse on the job was a case of unintended magic caused by anger, like when Harry exploded a wine glass because he was mad about what his aunt said.
“It’s one of the basic rules of breeding,’ she said. ‘You see it all the time with dogs. If there’s something wrong with the bitch, there’ll be something wrong with the pup –’
At that moment, the wine glass Aunt Marge was holding exploded in her hand. Shards of glass flew in every direction and Aunt Marge spluttered and blinked, her great ruddy face dripping.”
- Harry Potter and the Prisoner of Azkaban, Chapter 2 (Aunt Marge’s Big Mistake)
Harry didn’t actually mean to explode the glass, so it’s possible that the Dark Lord similarly was angry at Dumbledore denying him the job and his anger created the curse on it without him consciously doing it.
“Outside in the hall, he leant against the wall, breathing deeply. It had been a long time since he’d lost control and made something explode.”
- Harry Potter and the Prisoner of Azkaban, Chapter 2 (Aunt Marge’s Big Mistake)
Therefore, the Dark Lord may not have realized that the job was cursed, so might not have known that there was any need to take any sort of action to prevent Barty Crouch Jr. from getting cursed. Although he didn’t care about his followers, it seems unlikely that the Dark Lord would put Barty Crouch Jr. at needless risk, since he regarded him as an intelligent and highly faithful follower - he’d consider it a waste.
“By that time, my faithful servant will have rejoined us –’
‘I am a faithful servant,’ said Wormtail, the merest trace of sullenness in his voice.
‘Wormtail, I need somebody with brains, somebody whose loyalty has never wavered, and you, unfortunately, fulfil neither requirement.”
- Harry Potter and the Goblet of Fire, Chapter 1 (The Riddle House)
From this, it seems unlikely the Dark Lord would want to risk having Barty Crouch Jr. get cursed without it being necessary to his success, since he considered him useful.
If Dumbledore warned, it’d be Moody.
Barty Crouch Jr. only became Moody the day before he was to start teaching at Hogwarts. Moody was offered and accepted the position before that, and if Dumbledore warned him, it’d likely be then.
“Wormtail and I did it. We had prepared the Polyjuice Potion beforehand. We journeyed to his house. Moody put up a struggle. There was a commotion. We managed to subdue him just in time. Forced him into a compartment of his own magical trunk. Took some of his hair and added it to the Potion. I drank it, I became Moody’s double. I took his leg and his eye. I was ready to face Arthur Weasley when he arrived to sort out the Muggles who had heard a disturbance. I made the dustbins move around the yard. I told Arthur Weasley I had heard intruders in my yard, who had set the dustbins off. Then I packed up Moody’s clothes and Dark detectors, put them in the trunk with Moody, and set off for Hogwarts.”
- Harry Potter and the Goblet of Fire, Chapter 35 (Veritaserum)
By the time Barty Crouch Jr. became Moody, Dumbledore would probably have given the real Moody any warnings he’d wanted to, so Barty Crouch Jr. wouldn’t have gotten them.