Activate a slave only after the first heartbeat.

Do not assume a slave to be ready for session assignment after a handshake,
always wait for a first heartbeat.
Properly define the COCAINE_DEBUG flag.
Cleanup.

Drop the dead code.