Steward Health Care said Friday that it is closing two of its Massachusetts hospitals — Carney Hospital in Dorchester and Nashoba Valley Medical Center in Ayer — that received no qualified bids in its sales process. The bankrupt company said it will shutter the hospitals by the end of August.