Support directory names with '\'-characters in filename().

When using Windows, file and path names used in filename() had a
different separator. 

Change-Id: Ia4b994430b2a389353955dc8858c204e6150e375