Cancer and stroke NHS patients among thousands discharged into homelessness