Almost half of people reported difficulty sleeping as four heatwaves hit the UK this summer and 11% said their health deteriorated.