Berkshire Hathaway chief ends more than three-year selling streak as he ploughs a net $20bn into stocks