I've worked on both sides of this equation for quite a number of years (lead engineer at Crazy Daisy Productions).
I've mastered a very large number of tracks for music libraries wanting to ensure quality and consistency in their sound, particularly when they're selling collections of tracks in a particular theme, which may be from a variety of different composers. I've also helped a large number of artists in a wide range of genres mix and master their songs to prepare them for pitching to libraries and publishers - with good results.
My recommendation is to fully mix and master any tracks that you plan to pitch to music libraries. This includes libraries you may already have a working relationship with, since they will still want to hear your songs first before deciding to accept them. Then, once you have material accepted, ask them if they would like the unmastered versions - in other words, do they have their music mastered before releasing it?
So, even though you should absolutely send the most polished version you can when you submit it to them, be ready to provide them with: an unmastered version, unmastered stems, unmastered and mastered shortened versions and reduced versions (i.e. 30 and 60 second versions, and versions with vocals and/or main melody line instruments removed). Depending on the library, and also on what they have planned for your material, they might request any of these options. If you're prepared going into it then it won't be any issue and you can quickly and easily provide whatever they want. Fast response on your part helps develop your working relationship and they're more likely to request and accept more tracks from you in the future.