The first step to make the charging circuit more reliable is to add a diode. This makes sure that the current is only flowing in the way we want it to flow, out of the energy source to the battery.
The diode blocks the current if the voltage is wrong.
So only when the +voltage of the source is higher than the +voltage of the battery the current will flow.
Interesting to know: an LED is also a diode.
How a diode works is complicated stuff: http://electronics.howstuffworks.com/diode1.htm
The symbol of the diode is not too difficult to understand. The thing itself has a marked side, which corresponds to the black horizontal line.
If you have a source which is producing alternating current (or voltage) like a piezo element, you could not have used this without a diode. But in this situation you can only use one halve of the energy the piezo element is producing. The other half is blocked by the diode and is lost.
To solve this you have to use a bridge rectifier.
You can make the bridge rectifier with 4 diodes or buy it as a component (four legs).
The diode “eats” a bit of the voltage. For a normal diode like N4148 this is 0.7 V. This is lost energy! One of the solutions is to use a special diode called a Schottsky diode. This diode consumes less Voltage, around .3V, as you can see in this picture:
Because the energy you harvest are not big in general, you have to avoid every loss of energy!