Fix segfault on ruby >=1.9 when calling putspent

When calling `putspent` or `fgetspent` on linux we'd get a core dump. Using the function `rb_io_stdio_file` to grab the stdio file handle instead of directly using the `stdio_file` member fixed the problem.