Update synchronized decorator so that it can be used as a context manager for synchronized statements.
Extend synchronized example to show how can implement a context manager for synchronised statements.