[IMP] Make compatible with php 5.4

In that case, the list will not be very long because that's the list of arguments for the Magento's API methods. Most of the time, there is 1 to 3 arguments, sometimes a few more. When popping, the list is shrunk when the new size is less than the half of the allocated size, which will never or hardly never happen here since usually there is only 1 or 2 trailing None, if any. So I prefer the readability of the popping in this specific case.