RBS posts £5.2bn loss in ‘chastening year’