Prices increased by 9.8% in 2021 as buyers sought more space during lockdown, the Halifax says.