Fix for OS X QFileDialog showing bundle as directory

Also check if the selectedFile is a bundle to correctly
set currentDir.

This fix does not apply to Qt 5 because QFileDialog has
been reimplemented differently and this file does not
exist anymore.

Task-number: QTBUG-31562

Change-Id: I145108647dd613cb529bb65bc6c7191154dab5b8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>