Backport from 9.2.x.
Dispatching execution of blocking code to a different thread to avoid
to block the selector thread.