I posted this question on a different site a couple of years ago. Eventually I found that a book of T.Y. Lam has a very nice treatment. Here is the writeup I posted on the other site:
After paging through several algebra books, I found that T.Y. Lam's GTM Lectures on Rings and Modules has a beautiful treatment of this question.
The above property of a (possibly noncommutative) ring is called the "strong rank condition." It is indeed stronger than the corresponding statement for surjections ("the rank condition") which is stronger than the isomorphism version "Invariant basis number property". However, in fact it is the case that all commutative rings satisfy the strong rank condition. Lam gives two proofs [pp. 12-16], and I will now sketch both of them.
First proof:
Step 1: The result holds for (left-) Noetherian rings. For this we establish:
Lemma: Let $M$ and $N$ be (left-) $A$-modules, with $N$ nonzero. If the direct sum $M \oplus N$ can be embedded in $M$, then $M$ is not a Noetherian $A$-module.
Proof: By hypothesis $M$ has a submodule $M_1 \oplus N_1$, with $M_1 \cong M$ and $N_1 \cong N$. But we can also embed $M \oplus N$ in $M_1$, meaning that $M_1$ contains a submodule $M_2 \oplus N_2$ with $M_2 \cong M$ and $N_2 \cong N$. Continuing in this way we construct an ascending chain of submodules $N_1$, $N_1 \oplus N_2$,..., contradiction.
So if A is (left-) Noetherian, apply the Lemma with $M = A^n$ and $N = A^{m-n}$. $M$ is a Noetherian $A$-module, and we conclude that $A^m$ cannot be embedded in $A^n$.
Step 2: We do the case of a commutative, but not necessarily Noetherian, ring. First observe that, defining linear independent subsets in the usual way, the strong rank condition precisely asserts that any set of more than $n$ elements in $A^n$ is linearly dependent. Thus a ring $A$ satisfies the strong rank condition iff: for all $m > n$, any homogeneous linear system of $n$ linear equations and $m$ unknowns has a nonzero solution in $A$.
So, let $MX = 0$ be any homogeneous linear system with coefficient matrix $M = (m_{ij}), \ 1 \leq i \leq n, 1 \leq j \leq m$. We want to show that it has a nonzero solution in $A$. But the subring $A' = \mathbb{Z}[a_{ij}]$, being a quotient of a polynomial ring in finitely many variables over a Noetherian ring, is Noetherian (by the Hilbert basis theorem), so by Step 1 there is (even) a nonzero solution $(x_1,...,x_m) \in (A')^m$.
This makes one wonder if it is necessary to consider the Noetherian case separately, and it is not. Lam's second proof comes, he says, from Bourbaki's Algebra (unfortunately he does not give a precise, Chapter III, §7.9, Prop. 12, page 519. [Thanks to Georges Elencwajg for tracking down the reference). It] It uses the following elegant elegant characterization of linear independence in free modules:
Theorem: A subset $\{u_1,...,u_m\}$ in $M = A^n$ is linearly independent iff: if $a \in A$ is such that $a \cdot (u_1 \wedge \ldots \wedge u_m) = 0$, then $a = 0$.
Here $u_1\wedge \ldots \wedge u_m$ is an element of the exterior power $\Lambda^m(M)$.
(I will omit the proof here; the relevant passage is reproduced on Google books.)
This gives the result right away: if $m > n$, $\Lambda^m(A^n) = 0$.