Kotoko rally back to hold Hearts