dialog: add wait-for-ack callback before response unref

- in case of a sipral for ending in a negative response from initial
  state, ack to second iteration can unref prematurely the dialog
- reported by Pawel Sternal, FS#427