kmsloop: Exit mainloop manually if the destroy function is executed by the main thread
kmsloop: Exit mainloop manually if the destroy function is executed by the main thread

Change-Id: I4ac7463d35c685fd73b888eb60a400ea02abdaeb

shelsonjava/kms-elements,Kurento/kms-elements,shelsonjava/kms-elements,TribeMedia/kms-elements,Kurento/kms-elements,TribeMedia/kms-elements,Kurento/kms-elements,shelsonjava/kms-elements,TribeMedia/kms-elements