Avoid error when using sub directories for assets

Added the same fix to Kha's flash backend.