Information given in Wikipedia
Brahma's curse
Lankini was once the guardian of the abode of Brahma. As she guarded the home of the creator, Brahma, she became arrogant and egoistic about her position. She treated others in the palace with contempt due to which she was cursed by Brahma to guard the city of Rakshasas forever. Lankini realized her mistake and begged for forgiveness. However, it was not possible for Brahma to take back the curse, and instead gave her a boon she will be freed of the curse only when a monkey will defeat her in combat and thus bring to end the age of Rakshasas.
Information given in Ramcharitramanas
masaka samāna rūpa kapi dharī. laṃkahi calēu sumiri naraharī
Hanuman assumed a form as small as a gnat and, invoking the Lord in human semblance (Bhagavan Sri Rama), headed towards Lanka
nāma laṃkinī ēka nisicarī. sō kaha calēsi mōhi niṃdarī
(At the gateway of Lanka) lived a demoness, Lankini by name. "Where should you be going heedless of me?" she said.
[5-3-1]
jānēhi nahīṃ maramu saṭha mōrā. mōra ahāra jahāom lagi cōrā
"Fool, have you not been able to know who I am? Every thief hereabout is my food."
muṭhikā ēka mahā kapi hanī. rudhira bamata dharanīṃ ḍhanamanī
The great monkey dealt her such a blow with his fist that she toppled down vomiting blood.
[5-3-2]
puni saṃbhāri uṭhi sō laṃkā. jōri pāni kara binaya saṃsakā
Then, recovering herself, Lanka (Lankini), stood up, and joining her palms in dismay, humbly addressed him,
jaba rāvanahi brahma bara dīnhā. calata biraṃci kahā mōhi cīnhā
When Brahma granted Ravana the boon he had asked for, the Creator furnished me with the following clue (to the extermination of the demon race) while departing
[5-3-3]
bikala hōsi taiṃ kapi kēṃ mārē. taba jānēsu nisicara saṃghārē
When you get discomfited by a blow from a monkey, know that all is over with the demon race
tāta mōra ati punya bahūtā. dēkhēuom nayana rāma kara dūtā
I must have earned very great merit, dear Hanuman, that I have been blessed with the sight of Sri Rama's own messenger
Translation
"When Brahma granted Ravana the boon he had asked for, the Creator furnished me with the following clue (to the extermination of the demon race) while departing:-'When you get discomfited by a blow from a monkey, know that all is over with the demon race.' I must have earned very great merit, dear Hanuman, that I have been blessed with the sight of Sri Rama's own messenger
In accordance with the boon given by Lord Brahma,Lankini thus got freed from her curse after getting the blessed sight of Sri Rama's messenger in monkey(vanara) form, viz Hanuman
Information given in Valmiki Ramayana
It is also possible to understand the boon given to Lankini by Lord Brahma, from Book V : Sundara Kanda - Book Of Beauty, Sarga 3.
The statements made by Lankini to Hanuman are compiled as under:-
"O long armed one! O best among Vanaras! Get propitiated and protect me. O gentle one! Those with great strength and courage always stand firm on tradition.O Vanara! I am myself the city of Lanka. O strong one! O courageous one! I am defeated by your strength.
O lord of Vanaras! In earlier times I had been given a boon by Lord Brahma. Hear from me about this matter.
Let this be known by you - whenever a Vanara conquers you with his might, then a fear will come for Rakshasas.
O gentle one! With your appearance now, that time has come for me. Ordinance of Brahma is the truth and is immutable.
The destruction has come for Ravana the evil minded king and to all Rakshasas due to Seetha."
The implicit meaning of the abovementioned compilation is that- since Lankini became a Rakshas due to a curse(and is not originally a Rakshas), Lankini would not get killed when it is time for all other Rakshashas to get destroyed ,and would get freed from her curse and become her original self again.
References:-(1) Wikipedia
(2)Ramcharitramanas, 143 - Description of Lanka; Hanuman strikes Lankini and enters Lanka
Reference links:-(1) https://en.wikipedia.org/wiki/Lankini
(2) http://www.ramcharitmanas.org/content-5-138-2100.html
(3)http://www.valmikiramayan.net/utf8/sundara/sarga3/sundara_3_frame.htm