Shutdown ExecutorServices on tests

Currently, the ExecutorServices used on tests are not shutdown after use.

This may cause the thread pools not to be released, resulting in `java.lang.OutOfMemoryError: unable to create native thread`.

This pull requests fixes those issues.