Pore entrance effects on the electrical potential distribution in charged porous membranes and ion channels