Former corrections officer sentenced for having sex with inmate