Fix memory leak of get_battery() and get_volume()