Generic useful *nix semaphore wrapper