The small fleet of 50 Dreamliners that are currently in service was recently grounded following two incidents involving the plane's unique li-ion battery system, including one in-air fire. After that happened, Musk tweeted about the battery situation that, "Maybe already under control, but Tesla & SpaceX are happy to help with the 787 lithium ion batteries." He then said he was in communication with the 787's chief engineer.
Now, the batteries in the Dreamliner and those in Tesla's electric vehicles are not the same, but Musk does have some experience sending carefully packaged lithium-ion cells into the sky with his SpaceX company. As he told Reuters in an email, "We fly high capacity lithium ion battery packs in our rockets and spacecraft, which are subject to much higher loads than commercial aircraft and have to function all the way from sea level air pressure to vacuum. We have never had a fire in any production battery pack at either Tesla or SpaceX."
The US National Transportation Safety Board continues to investigate the cause of the Dreamliner battery incidents. The Federal Aviation Administration is involved as well.