BOSTON — Gov. Deval Patrick on Wednesday appointed William Cowan, a Boston lawyer who is a longtime friend and former aide, to serve as an interim United States senator until voters chose a successor to John Kerry in a special election set for June 25.