Add on_prepare callback and move on_connect to the correct position

I wander we should merge this pull-req bacause it contains incompatible changes...

I think it affects to the code which suppose return value of on_connect is connect timeout. After patched this pull-req, connect timeout becomes return value of on_prepare callback (this behavior same as AnyEvent::Socket's $prepare_cb).