Determine the default number of heap/direct arenas of PooledByteBufAllocator conservatively

- Fixes #1445
- Add PlatformDependent.maxDirectMemory()
- Ensure the default number or arenas is decreased if the max memory of the VM is not large enough.