It is a courtesy accidental. This is an extra, unneeded accidental that the composer or publisher has added because they think that a mistake is likely. Here, with many of the Es flattened, including in the immediately preceding measure, the E natural may be a surprise. Many of the Bs are also flattened so the player might be tempted to switch into a B flat gear.
As you say, it is not needed but it is not forbidden either and it may help. Somewhat like adding (sic) in a document where you think that the reader may otherwise assume that you have made a mistake.
I read your question a little too quickly and concentrated on the natural in the 7th measure. As guidot says, the one the in 9th measure is a little unusual. Accidentals (unlike key signatures) apply only to the octave in which they are used. This particular B has not been flattened so it is in even less in need of a courtesy natural. I am not quite sure but I think that I have seen the occasional courtesy accidental in another octave. If B is frequently flattened (as here), the performer might be tempted to think that the key has changed and all Bs will be flattened. They might, like Tim, recognize the blues style but, if they don't then they may suspect that the piece has modulated to B flat.