Fix the memory leaks: when service stops, it should unregister the broadcast receiver.