[lib/connection]Use shared_ptr<Message> for MessageQueue to avoid memory-leak.
[lib/timer]Avoid heap-corruption by copying and removing head before invoking callback.