Cleaning up finally clauses with nested try blocks

The recently introduced SocketUtil makes it easier to close a resource in a finally block without nesting a try... improves readability.