Fix distributed deadlock between two sessions that are both sending messages to each other.
Does not hold the lock while sending data on the network.
Remove change unrelated to deadlock fix.
Merge pull request #287 from staffanu/fix_Deadlock2

Fix distributed deadlock between two sessions