Citing an unpublished paper? plagiarism?
There is no particular problem with citing unpublished work. Just list it as such. There is no problem with citing work that will not ever be published in fact. Just name the author and list it as "private communication". Give a title if appropriate, or a description. 

In the case at hand, it seems wiser to cite A within B as it is likely to be published first, but since you don't have the final version, it could be listed as "unpublished, in preparation". 

Talk to your advisor, of course, about what he/she recommends here. I think in most cases the rules on a thesis can be, with permission of the advisor, a bit looser than for formally published work. You need to cite, in any case, but the fact that things are a bit tentative can be finessed. 

As for plagiarism, cite your own work, whether joint or not, just as you would the work of another.