Context manager for pid-file locking in unix