It was often used in TV programmes such as Porridge and Minder. In the former the inmates were already doing bird in the latter Arthur Daley was constantly trying to not end up doing bird.
|Arthur Daley - at large and definitely not doing bird.|
It's possible that it was also used by criminals on their hands and where the expression 'sticky fingers' came from. The slang meaning however is rhyming lime with time,
'Time' is a slang description of a prison sentence, so there you have it.