Costain writes off £45m on Welsh road job