Make sure that when you buy it, that it is in one of a sealed 'duty free' bags - or it will be confiscated when you try to board the next flight.
At the duty free shop they will assume that you end your journey at Bangkok so you just get a cheap (open) plastic bag.
I (and others) have had bottles 'liberated' at Bangkok when transferring to Samui.
It happens when you board the domestic leg of your journey.
In your 'check in' luggage is safer.