Replaced Lock with higher-level synchronized keyword in PeerSocketHandler

* Removed unnecessary lock in PeerSocketHandler.sendMessage() as it wrapped only atomic null-checking.
* Replaced Lock with synchronized keyword in setWriteTarget() and close().
* Semantics should not change (but please do review).