[#1261] Close JMX RMI connector sockets on shutdown (#1264)
Fixes #1261.
With `rmi-port: 0`, every JMX handler start created a new RMI connector
listener that remained open after the handler stopped. Unexporting the
connector does not close an anonymous-port listener in the JDK. Repeated
embedded-server restarts therefore accumulated listening ports and
accept threads.
Retain the connector's socket factory and explicitly close its socket
after stopping the connector, for both plain and SSL connections. Both
factories implement `Closeable`, and the SSL factory now remembers its
server socket. Cleanup also runs if connector shutdown throws or a
configuration change keeps the RMI registry running. Repeated
finalization is safe.
The regression tests open real JMX sessions and verify that the old port
refuses connections and can be rebound after shutdown and after a
configuration change. They cover both SSL settings and three successive
handler start/stop cycles.
Validation on macOS:
- All four new regression cases failed on the original code because the
stopped listener still accepted connections.
- `JmxListenAddressTestCase` on JDK 27: 9 passed, 1 skipped.
- Full JMX package on JDK 17, using the Maven reactor and `precommit`
profile: 55 passed, 1 skipped; build successful.
- The existing wildcard-hostname case is skipped because the local
hostname resolves to loopback.
- `git diff --check` passed.