Implement failed callbacks in async IO on JVM.
Swallow AsynchronousCloseException and treat it as EOF.