Use flock to avoid concurrent access to authorized keys.