Bugfix #8: using netty's sync() instead of ad-hoc locking and threading.