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.