Add safeClose variant for AutoCloseables
Javadoc
Fix bug in HTTP upgrade implementation