Fixes small exception on shutdown when conducting tests

* When shutting down after tests, the dqp plugin can throw the 'programming
  error' exception produced by the DefaultServerProvider. The ServerCore
  can shutdown prior to the dqp plugin hence is no longer initialised.

* Only if the ServerCore is initialised is it necessary to remove the
  listeners from the server instances.