Check the return value of lo_export.

Patch by Ondřej Surý. Fixes bug #68697 (lo_export return -1 on failure).