Bug 20790: Fixed memory corruption problem with strndup

There was an off by one error in the jal_strndup code that was causing
various memory corruption problems.