This keeps all of the return codes in the same place and exposed publicly (as they are not internal to ES). I have also added proper IOSC error codes and renamed some codes for more consistency. (Unix ones have an E prefix, others do not.)