Implemented synchronization during creation/playing/closing a remote stream.

The creation, playing and closing of remote streams are now inside
synchronized methods. This is necessary because multiple threads might
try to create and/or close the same stream at the same time.