Hornby has agreed to sell off a loss-making subsidiary which makes Oxford Diecast models.