Fix checking stream status on write (getStatus() can return PEAR_Error)