adding better code for operation waiting in order to avoid shutting down the pool too early and creating operation reject exceptions.