MDL-48587: Fix error in getremoteaddr for unsupported php versions