The Thrift server does not clean up selectors after stopping, which leads to a
file descriptor leak. This ugly hack takes care of the issue until Thrift is fixed.