cleanup: no need to lock at obj level anymore
fix: out-of-bound array access

Moreover we use here a better error handling (only fsapi has to deal
with errno values, translated from ELF_* error codes)