The UK has plenty of time to have an election -- or a referendum. I am sure that the EU would agree to any required extensions.
The EU is unhappy about their position -- they are determined to punish any who leave with a bad deal as they have to do so to prevent more from leaving. Punishing the UK will also hurt the EU. Brexit costs the EU serious money that they have to make up. You can be sure any sign that the UK might have second thoughts will be allowed room by the EU.