Make safe realpath evaluation
Make safe realpath evaluation

Split "saveAs" path into dirname and basename and perform realpath only
on first one.
This was done, because if we're using $saveAs feature input file will
not actually exists (it's a mock filepath to create correct cache path).

jmcclell/AvalancheImagineBundle,snpy/AvalancheImagineBundle