Prior exposure to stress allows the maintenance of an ecosystem cycle following severe acidification