[SPARK-3187] [yarn] Cleanup allocator code.

Move all shared logic to the base YarnAllocator class, and leave
the version-specific logic in the version-specific module.

I know you just copy and pasted this but this seems wrong. I would have thought it would add back in any < 0.  To set it to 0.