Defense stands tall in fourth quarter, Titans edge Buffalo