Check return value of dir() in Skin.php

This avoids a fatal, when something is wrong with $wgStyleDirectory or
the directory referred there.

PHP Fatal error: Call to a member function read() on a non-object in
Skin.php

bug: 42167
Change-Id: I3d63cb984bc2aa0f85ade04607862c639ba51fdb