util.c: let getcwd allocate buffer

* util.c (ruby_getcwd): POSIX.1-2001 extends getcwd(3) as it
  allocates the buffer if the argument is NULL.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e