Hedge funds piled into short bets against Tesla Inc. right before the electric vehicle maker unveiled a set of numbers that triggered a hefty share-price rally.