In my personal experience, references haven't been taken up until after I've started the job and then only rarely.
If you have to tell your current employer that you have been offered another job and will take it as long as they (the current employer) give a good reference, that's not going to incentivise them to give you a good reference.
Its also going to make things awkward if you stay.
I'd expect you to take the new job, leave, maybe they take up the reference, if they do, your current employer should give you a good reference unless you already have a bad relationship with them or tell them to go fcuk themselves when you hand in your notice
Usually, when changing jobs, I've talked to the boss and basically said I'm leaving. I really want to make sure that the impact on the rest of the team is minimised. Can we formulate a plan so that the handover is as smooth as possible, I get to leave on the date I want to and everybody is left with a nice feeling about a job well done ?