Fix compatibility with latest undertow, and convert to non-blocking