Fix sample API.

If a zero length file is uploaded the result will not have an object key.

If the return value of handle_uploaded_file() is <= 0 an error could not
be determined, so move that into an else clause appropriately. Without this
the real error message can be obscured.