Correctly send join message

Even if no users where on this resource, at least the newly connected
one gets notified of it join. It can be useful for managing resources in
the resource actor.
Code improvements

While debuggin the problem with the join message I had to add some
logging here and there, and I fixed some code style issues that led to
timeouts under certain circumstances. It would be a pity to throw
everything away, so I include it here. The code should be more robust
now.
Merge pull request #77 from satabin/wip-correct-join

Fix join message
[imp #78] Always retrieve broadcast message

Instead of sending pending messages when the user sends a specific message,
always send them back with any synchronization session.
Do not delete peer when retrieving messages

Its list of pending messages is simply reset but the peer itself is not
removed from the list of connected peers.
Merge pull request #79 from chemicalstorm/fix-78

[imp #78] Always retrieve broadcast message
Replace malformed input character and go on

if input is malformed in a log file, just replace the malformed
character with the default codec replacer and continue decoding instead
of failing.
Send log in UTF-8