Almost 22,000 homes may have been lost in Scotland during the last year due to perceived hostility towards landlords and concerns over increasing regulation.