"one who pecks," 1690s, agent noun from peck (v.); slang sense of "penis" is from 1902.
The penis (1902+)