* [core]: skip trailing slash in directory names

fixes directory detection on MinGW. stat() appears to ignore
directory path names with trailing slash like "/c/Users/my_account/",
while "/c/Users/my_account" is accepted on that platform. On linux it never
appeared to be an issue.