Whitelock is onside at the ruck. Doesn't he remain onside once the ruck is over?
Correct in the first bit, no in the second. Being onside but competing at the ruck means he is in front of the last feet and once the ruck is over can't play the halfback or make a tackle until he is put onside.
If the referee is suggesting that Whitelock still has rights to the ball in the ruck then Perenara doesn't have free reign to pick it up without interference. I don't think you could say that Whitelock hasn't gone for the ball until it is in Perenara's hands and the ruck is over (and at which time Whitelock would be offside).