High-order time-adaptive numerical methods for the Allen-Cahn and Cahn-Hilliard equations