I think that Fain (who possibly already had a run in with Mordeth, or they just merged the characters) is already aligned with Mashadar - but Mashadar is trapped in Shadar Logoth still. Notice how Fain started whistling, and it came out like an eager puppy? I think his plan was to wait until...