Call on-close handlers on calling thread when threadpool is closed

Without this precaution, calling the returned stop function on
a server with pending handlers will raise execution rejected
exceptions since no slots are available in the shut-down pool.