Fix content folder location on MacOSX. Exit samples if resources can't be found.

All the code to locate the resource folder `Content` is isolated inside the `extractResourcePath`.
When the samples can't load the resources, they are stoped instead of showing a window with flickering garbage.
Fixed resource logic on Linux.