sip_transaction: race condition on terminate

Fixed a race condition in the pjsip_tsx_terminate function that allowed the
state to potentially be set to terminated twice that subsequently ended in
a crash.
Merge pull request #14 from asterisk/sip_tsx_terminate_race

sip_transaction: race condition on terminate