caching_server: kill lingering caching_server before starting it

If a process is bound to the caching server port for whatever
reason, we need to kill it before restarting a new one.

BUG=b:152976288
TEST=Manually do the following test on a chameleon host.
   # Remove the pid file so that chameleond would not be stopped.
   1. rm /var/run/chameleond.pid
   # Restart chameleond.
   2. /etc/init.d/chameleond restart
Without applying this patch,
   observe the following error messages in /var/log/chameleond_init
   socket.error: [Errno 98] Address already in use
With this patch,
   the above errors should not be seen.

Change-Id: I1160e4b704eff830941eff3d952aa6e715bce5ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/chameleon/+/2179683
Reviewed-by: Michael Sun <michaelfsun@google.com>
Commit-Queue: Shyh-In Hwang <josephsih@chromium.org>
Tested-by: Shyh-In Hwang <josephsih@chromium.org>
1 file changed