libril: fix crash in qcoms ril library during DIAL

thanks Drummerjed and mithun46(omnirom)
picked from :- https://gerrit.omnirom.org/#/c/2770/