stop socket code cleanup, tomcat.destroy() when stopping

Before this change when tomcat was stopped (in non daemon mode) System.exit(1) was called causing the gradle daemon to exit although we only want
tomcat to stop. I think this was done because the ports were not released by tomcat because tomcat.destroy was not called when
stopping.

Right now we call tomcat.destroy() after stopping thus releasing the resources and allow gradle to run in daemon mode.
When tomcat runs in daemon mode it shouldn't be treated differently from when it runs in non daemon mode so it is stopped by the same mechanism.

This should fix a couple of issues from the tracker regarding stopping tomcat.