Use `__FILE__`'s dirname when `__dir__` is unavailable

This is to allow tests to run on Ruby < 2.0.
Make note that libgphoto2 >= 2.5.0 is required