Rewrite property safely - use file locking