JP Morgan and Bank of America are preparing to lend Hershey about $7 bn (£4.2 bn) to help it enter a bidding war on Cadbury.