It is possible to place locked containers with this command:
/setblock ~ ~ ~ container{Lock:"Key"}
This should also be possible with chiseled bookshelves. It would be an excellent feature for adventure maps because it would allow creators to make some books accessible and others inaccessible.
This is a feature request not a bug