Cache watch service
Cache watch service

I noticed that my custom WatchService was never cleaned up by sbt and
realized that after every build we were making a new WatchService. At
the same time, we were reusing the WatchState from the previous run,
which was using the original WatchService. This was particularly
problematic because it prevented us from registering any paths with the
new watch service. This may have prevented some of the file updates
from being seen by the watch service. Moreover, because we lost the
reference to the original WatchService, there was no way to clean it up,
which was a resource leak.

May be related to #3775, #3695

mdedetrich/sbt,xuwei-k/xsbt,mdedetrich/sbt,mdedetrich/sbt,mdedetrich/sbt,sbt/sbt,sbt/sbt,xuwei-k/xsbt,xuwei-k/xsbt,mdedetrich/sbt,sbt/sbt,sbt/sbt,xuwei-k/xsbt,sbt/sbt,sbt/sbt,mdedetrich/sbt,mdedetrich/sbt,xuwei-k/xsbt,sbt/sbt