Fixed #1112: Using thread_pool_executors causes segfault, adding test