People who regularly eat chocolate may have a lower risk of developing an irregular heartbeat, a new study has found.