Fix #4380, making get code and get message final

In order to match with PHP getMessage() and  getCode() changed to final so they can not be overwritten.