Critical and noncritical long-range entanglement in Klein-Gordon fields