Or not.

The way I heard it the clear account of how it could have made its way into English was that English soldiers picked it up from Malaysian salang which was from Arabic salaam. My understanding of the use of salaam is that it is used both as a greeting and as a farewell. Any or all of the above could be wrong, but that's the way I heard it.