Update RingHost.c

Okay, I have got a function that will lock and unlock the files. Don't have to worry about race condition or unlocking even when the program crashes.