[PATCH] qrap: Don't rely on errno after perror(), and reset it before usage