Unused places of worship in Wales could provide 7,000 homes, a report has found.