If a prisoner is confined for safekeeping, the prisoner’s earnings, after paying for board, shall be paid over to the prisoner on discharge.