Correctly calculate the phase flag when YD are input

Closes https://github.com/CoolProp/CoolProp/issues/273

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>