Yes, normally when one finds a not controlled return of db2, and abend the program, the cursor remains closed.
The cases in which you can found sqlcode -502 (the cursor identified in an open statement is already open) are because the program has finished without there be executing the statement EXEC SQL CLOSE CUR-NN END-EXEC.
I didn't get you Xungo...in program, before executing cursor close statement, if program abends then will that cursor close automatically or when we run that program again after the abend it will give -502?