clean up semaphores and shared memory by process ID on Redhat OS