On a serious note, I'd view a long rest as finishing when both players and DM agree that is has and they're ready to get on with the day.
Long rest isn't just sleeping, its the setting up and breaking camp, breakfast, setting and checking traps, packing, and of course the latrine arrangements etc.
So yes, the Warlock can wait until the long rest is over, strangle his rat, and then ask the DM if they can start a short rest, while the rest of the party make a start poking around the ruins or scouting the orc camp or whatever.
Hmm.
You know, technically, the Warlock could actually cast their Hex and throttle the weasel during the Long rest, and then still regain all of their spell slots at the end of the long rest.