[S] Change in libosmocore[master]: socket: Cache errno before calling further functions