Correct and simplify use of ERR_clear_error() etc. for loading DSO libs