Why would you take a visual in anything but good VFR conditions,
You wouldn't, unless you were properly insane.
once you've accepted the visual, you have cancelled your IFR flight plan and are obliged to observe the VFR flight rules
That's not correct. Cancelling an IFR flight plan does not happen incidentally like that; it must be a formal and acknowledged communication.