Finite-volume effects on octet-baryon masses in covariant baryon chiral perturbation theory