What does 'fast friends' mean?

Solution 1:

From Merriam-Webster:

fast
[...]
2 : firmly loyal <became fast friends>

From Wiktionary:

Of people: steadfast, with unwavering feeling. (Now only in set phrases like "fast friend".) [from 10th c.]

Etymonline provides some background:

O.E. fæst "firmly fixed, steadfast, secure, enclosed," probably from P.Gmc. *fastuz (cf. O.Fris. fest, O.N. fastr, Du. vast, Ger. fest)

Solution 2:

The sense of "fast" here is almost obsolete; it's the "fast" of "steadfast," as noted by RegDwight above. It means "tight" or "secure," and you'll see it in literature in expressions like "hold fast" meaning to "get a tight grip" (on something). "Hold fast to your dreams" means to keep them close and never let them go.

Which is exactly what you should do with a good friend.