In case anyone is wondering why this hack is really necessary, I've attached a test program illustrating that closing the socket used by the RMI Registry is inherently asynchronous (unlike closing a plain old ServerSocket, if my tests are to be believed).
In the attached jar, run class com.philharveyonline.SocketPlay, and notice that it sometimes complains that the port is not free after the socket has seemingly been closed.
The program is managing the socket using LocateRegistry.createRegistry / UnicastRemoteObject.unexportObject. If you edit the code to use SocketHelper instead of RmiSocketHelper, the socket is managed using straightforward new ServerSocket / socket.close calls. In this case, it never complains about the port not being freed up.