PHP-1142: Support upserted ids in WriteResult

Renamed getGeneratedIdsForUpsert() to getUpsertedIds().
PHP-1142: Dump WriteResult object in write tests
Use correct return types for WriteResult-related init functions

We never check whether WriteResult init succeeds, which is fine as it sets whatever it can on the corresponding object. For the error inits, we actually do care if they succeed or fail so that we can free up the zvals; however, the return types should be booleans.