If you’re bargain-hunting for your next home, you may stumble across foreclosed homes at great prices. Here’s what you need to know before you commit.