Support ping cancellation.

Fix #8.