MODE-2058 Fixed repository#shutdown so that when the JNDI context is read-only, the shutdown doesn't fail.

Also, made Connectors & Query engine shutdown more fault-tolerant and refactored the Sequencers dependencies.