Loop coalescence in flares and coronal x-ray brightening