IDEA-119665 Memory leak in RemoteMavenServer when buildnumber plugin is used

Addressing issue by monitoring shutdown hooks before and after maven execute.