There are some issues with powering your hub from one of those adapters:
The first is as you suggested, losing power when the key goes off but before the PC shuts down. Powering from constant 12V as you said is a continuous draw from the battery and poses its own problem if you don't drive the car every day. The second issue is that of current requirements. Most of the cigarette lighter adapters that make 5V are meant for charging a phone or running a GPS. They usually have limited current outputs. To correctly power a hub, you should have a minimum of 0.5A per port plus count the hub itself as a port. So a four port hub should be provided with a 5V source capable of 2.5 Amps. You can adjust the total downward if you know that the devices you will have plugged into the hub use less power, but be aware that if you get close to the maximum power available the voltage will drop below 5V and then the PC will get confused about which devices are there leading to unpredictable results.