Yeah, this is one thing that sucks about renting and it has happened to me a couple times.
It sounds like the sale hasn't occurred yet. The good news about this is it may take a long time to sell and the new owner has to honor the leasehold regarding notice period law. (Read up on it now if you haven't -- in some places the effective notice period is longer than 30 days.) The bad news is the new owner may want you out in order to renovate or live there, and there's nothing you can do about it. In any event the new LL won't know you the way the old LL does and lots of people are good tenants. You are a "new tenant" to a new owner.
Get into the mindset that you may be moving in a few months so start to get a feel for what kinds of units are renting for how much. Get around, maybe even look at one or two places. The more you are ready for it, the less jarring it will be when that happens. It may end up being a positive -- one time I had to do it I ended up moving into a better neighborhood, closer to downtown and to work; the second time I found a larger condo in the same building. Higher rent in both cases but I though it was worth the trade-off.
Don't force the issue. As I've said in other posts, inertia is your friend. Let the new LL come to you.
Regarding your security deposit, when you move out ask for a walkthrough and take pictures. Usually the LL has to document any reduction in the deposit, such as with pictures of his own or a cleaning bill over and above typical turnover expenses. If that is not explicitly the law, as it is in Chicago, a judge will still usually want more evidence than "it was really dirty". Sounds like you'll be staying in the same area, so you can take him to small claims if necessary.