PHP library does not encode path arguments of API calls

This can lead to bogus results under rare circumstances; cf.
http://drupal.org/node/1992748