I've had a rMBP have consistent restart issues due to a USB device, but my second guess, if it's not a bad run of Apple products, is that however the power is being supplied isn't correct (enough, or voltage isn't consistent, bad outlet, etc). The USB issues I've had have been power draw issues. Maybe the iMac is drawing more power than previous computers. Uncommon computer problem, but worth trying another outlet.