Added 'wait for acknowledgement' feature

Hey Rich, here's the change I made ages ago. The change causes it to wait until an IM message is actually acknowledged by the receiver before considering it sent.

Still haven't tested it as I don't have a PHP env set up anywhere. Next time you make some changes to this can you test this change. Cheers