Nick meaning catch has been with us since the 1600s and, almost certainly, nick meaning prison comes from that...ie you're put in the nick when you've been caught. The jail meaning started life, however, as Australian slang in the 1880s. Nick meaning condition is a relatively recent coinage, having started life as a dialect word in the late 19th century. Finally, though you do not mention it, nick meaning the exact moment...as in 'in the nick of time'...is oldest of all the above and has been used since the 1500s.