Fix #377, fix expanding relative path on Windows

Before this change, we determine if an input is relative path only take
into account of unix, that is whether a path starts with "/".
This doesn't work on Windows where paths like "C:\Users\Foo" shouldn't
be expanded.