Hi,
Since Selenium uses Jetty server, you should be able to start and stop the server in-process rather than invking the command line. I am not sure how exactly to do that, you probably need to look up the source if no one has ansewered.
A less ideal option is to shutdown the server by doing an HTTP GET at URL:
http://localhost:4444/selenium-server/driver/?cmd=shutDown
You might need to change the port number to match your selenium server
Shane