People with an irregular sleep pattern are at a heightened risk of heart attacks and strokes.