For a finitely generated module $M$ over a commutative ring $R$, the first definition gives a rank *function* $r_M: \operatorname{Spec} R \rightarrow \mathbb{N}$, whereas the third definition gives $r_M((0))$.  

When $M$ is projective, $r_M$ is locally constant, so when $\operatorname{Spec} R$ is connected -- so when $R$ is a domain -- $r_M$ is constant and may be identified with its value at $(0)$.  I think you are asking for reassurance that for finitely generated non-projective modules over a domain, the rank function need not be constant.  That's certainly true: take $\mathbb{Z}/p\mathbb{Z}$ over $\mathbb{Z}$ (or even over $\mathbb{Z}_p$): then the rank function is $1$ at $(p)$ and otherwise $0$, so the first definition really is not the same as the third.

Is this a problem?  I don't think so.  Asking for terminology in mathematics to be globally consistent seems to be asking for too much: even more basic and central terms like "ring" and "manifold" do not have completely consistent definitions across all the mathematical literature: rather, they overlap enough to carry a common idea.  That is certainly the case here.

Similarly, asking which of 1) and 3) is "right" doesn't seem so fruitful.  It is true that the first definition records more information than the third definition.  But it's just terminology, and it is often useful to have a term which records exactly the information in the third definition: e.g. the "rank of an abelian group" is a very standard and useful notion, and <s>usually</s> often it means 3).  (I am a number theorist, and in number theoretic contexts this definition of rank is quite standard.  Apparently it is less so elsewhere...)  For a finitely generated module over a PID, of course the rank in the sense of 3) is exactly what you need in addition to the torsion subgroup in order to reconstruct the module.  In this context the rank function 1) gives some information about the torsion but not complete information -- e.g. $\mathbb{Z}/p\mathbb{Z}$ and $\mathbb{Z}/p^2\mathbb{Z}$ have the same rank function -- so the rank function as in 1) does not seem especially natural or useful.  I am (almost) sure there are other contexts where it would be natural and useful to think in terms of the rank function as in 1).  

<b>Added</b>: Following quid's comments I checked out Fuchs's text on infinite abelian groups, and indeed the rank of an arbitrary abelian group is defined in a way so as to take $p$-primary torsion into account.  (I simply didn't know this was true.)  Thus the rank defined there would be the sum over all the values of the rank function in the sense of 1). 

All this seems to indicate, even more than my answer, that different notions of rank proliferate.  


<b>Added Later</b>: Quid also suggests consideration of the quantity $\operatorname{mg}(M)$, the minimal number of generators of an $R$-module $M$: this is a cardinal invariant which is (clearly) finite if and only if $M$ is finitely generated.  Let $R$ be a Dedekind domain with fraction field $K$.  For a maximal ideal $\mathfrak{p}$ of $R$ and a finitely generated $R$-module $M$, let $M[\mathfrak{p}^{\infty}]$ be the submodule of $M$ consisting of elements annihilated by some power of $\mathfrak{p}$.  Then $M[\mathfrak{p}^{\infty}]$ is a finitely generated torsion module over the DVR $R_{\mathfrak{p}}$ and is thus a direct sum of $\operatorname{mg}(M[\mathfrak{p}^{\infty}])$ copies of $R_{\mathfrak{p}}/\mathfrak{p}^k R_{\mathfrak{p}}$.  Let us define $tr(M,\mathfrak{p})$ to be this number of copies.  (When $M$ is infinitely generated I believe one should also count copies of $K_{\mathfrak{p}}/R_{\mathfrak{p}}$ in a certain sense in order to recover Fuchs's $p$-primary torsion rank in the $R = \mathbb{Z}$ case.  Let me omit this for now.)  

Now define

$R(M) = r_M((0)) + \sum_{\mathfrak{p} \in \operatorname{MaxSpec} R} tr(M,\mathfrak{p})$

When $R = \mathbb{Z}$ then $R(M) = \operatorname{mg}(M)$ is the "total rank" in Fuchs's sense.  More generally $R(M) = \operatorname{mg}(M)$ when $R$ is a PID.  However, I wanted to point out that in general the function $\operatorname{mg}$ behaves *very badly*. This is discussed in $\S$ 6.5.3 of [my commutative algebra notes][1].  In particular, when $M$ is finitely generated projective, $\operatorname{mg}(M) \geq R(M) (= r_M((0))$ but can be larger.  The structure theory shows that if $r(M) = n$ then $n \leq \operatorname{mg}(M) \leq 2n-1$ and I give examples in the exercises with $(r(M),\operatorname{mg}(M))$ equal to 
$(1,1)$, $(1,2)$, $(2,2)$ and $(2,3)$.  I would guess that all values in the above range are possible assuming that $\operatorname{Pic} R$ is sufficiently large, but I haven't thought seriously about it. 


[1]: http://math.uga.edu/~pete/integral.pdf