Fixed delayed sendMessage when waiting for connection.

Jira issue: wp-1330