wavpack: Check error codes rather than working around error conditions.