MB-12613_2 Clang static analyzer bug fixes

dead assignments, dead initialization, UNIX api errors, uninitialized use

Change-Id: I88d647178d26ff1dbfaee467fcedcc12b9e1e686