osd/ErasureCodePlugin: close library before return on error

close and free resources for library before return

Signed-off-by: Xing Lin <xinglin@cs.utah.edu>