libbio: add casts to remove -Wconversion warnings

Update issue 5764

R=golang-dev, dave, rsc
CC=golang-dev
https://codereview.appspot.com/12388043