Add realpath for Windows

Fixes #4446
Add 2nd try if the 1st buffer is too small.
add vectorized ifelse functions
fix #4581
Merge pull request #4582 from lindahua/dh/ifelse

add vectorized ifelse functions
Merge pull request #4573 from karbarcca/patch-3

Add realpath for Windows