Two-flavor QCD at finite quark or isospin density