The electric vehicle maker vowed to appeal after a Delaware judge rejected the tech mogul’s massive compensation deal for a second time.