Prison guard locked up by inmates during attempted escape, SC officials say