Write passwd atomically