An action for the recovery of the possession of real property against a person in possession cannot be prejudiced by an alienation made by that person either before or after the commencement of the action. If the alienation is made after the commencement of the action and the defendant does not satisfy the judgment recovered for damages for withholding the possession, the damages may be recovered by action against the purchaser.