dialog: check if the transaction is created for BYE closing the dialog

- if not, release the dialog, because there will be no tm callbacks
  called later to release it. In this way avoid zombie dialog.
- reported by Ovidiu Sas, FS#424