Rite Aid posts wide loss, to shutter up to 117 stores