Thousands of onshore wind jobs were lost in the UK between 2016 and 2017, while employment in offshore wind has more than doubled since 2015, according to government figures.