All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
What you did was wrong, and it was a sin for which you should repent to Allaah. Stealing is forbidden even if the stolen item is a Mus-haf (i.e. the Quran Text Book). You should return the Mus-haf to where you stole it, if they are Muslims; because among the conditions of a sincere repentance is to give the people back their rights.
The fact that the Mus-haf was not put in a proper place does not permit you to steal it. It is enough to tell the librarian that the Mus-haf is not in a proper place so that he would place it in a proper place, or that you would put it in the proper place yourself.
Allaah Knows best.