rtjpeg: return meaningful error codes