Some specialty finance companies that lend to midsize businesses are confronting the threat of a funding squeeze just as the coronavirus pandemic is causing defaults to rise, a potential one-two punch that could curtail their activities.