Ford posts surprise profit as prices surge for scarce vehicles