Terminate JVM if server.close() has no effect (#12363)

Change-Id: If024d94d496a6cf2e6f0f342d368ac7bd746de38