Effects of the Kaluza–Klein theory on a Klein–Gordon particle with position-dependent mass